Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

"docker: command not found" error when running code-deploy pipe

I’ve copied the `script` entry given in the documentation of the atlassian/aws-code-deploy pipe and adapted to my needs:

pipelines:
branches:
master:
- step:
name: Build
image: node:10
script:
- ...
- step:
name: Deploy
script:
- pipe: atlassian/aws-code-deploy:0.2.1
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: 'us-east-2'
APPLICATION_NAME: $APPLICATION_NAME
COMMAND: 'upload'
ZIP_FILE: $ZIP_FILE
S3_BUCKET: $S3_BUCKET

When the pipeline is run, I get the following error:

 docker container run \
--volume=/opt/atlassian/pipelines/agent/build:/opt/atlassian/pipelines/agent/build \

--volume=/opt/atlassian/pipelines/agent/ssh:/opt/atlassian/pipelines/agent/ssh:ro \
...

bash: docker: command not found

My pipeline is using the default Docker image.

4 answers

1 accepted

4 votes
Answer accepted

I was able to fix the problem by adding the `docker` service to my step:

 - step:
name: Deploy
services:
- docker
script:
- pipe: atlassian/aws-code-deploy:0.2.1
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
...

I had same issue i just reruned pipelines again and it works.

0 votes
Xinyi Xu Atlassian Team May 22, 2020

Hey, accepted answer doesn't work for me. I was able to make it run adding optioins:docker: true to the end. See below

pipelines:
branches:
master:
- step:
name: Build
image: node:10
script:
- ...
- step:
name: Deploy
script:
- pipe: atlassian/aws-code-deploy:0.2.1
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: 'us-east-2'
APPLICATION_NAME: $APPLICATION_NAME
COMMAND: 'upload'
ZIP_FILE: $ZIP_FILE
S3_BUCKET: $S3_BUCKET

options:
docker: true

I have the same issue and this solutions doesn't help me.

pipelines:
branches:
master:
- step:
name: Build
image: node:10
script:
- ...
- step:
services:
- docker
name: Deploy
script:
- pipe: atlassian/aws-code-deploy:0.2.1
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: 'us-east-2'
APPLICATION_NAME: $APPLICATION_NAME
COMMAND: 'upload'
ZIP_FILE: $ZIP_FILE
S3_BUCKET: $S3_BUCKET

add docker as services it will fix the issue

You must have a reserved Variable called PATH, in your enviroment. 

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket Pipelines

Bitbucket Pipelines Runners is now in open beta

We are excited to announce the open beta program for self-hosted runners. Bitbucket Pipelines Runners is available to everyone. Please try it and let us know your feedback. If you have any issue...

3,955 views 68 21
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you