Hello everyone,
I am trying to create an automated docker image build using pipelines, but i keep running into the same error:
<span>+ docker version</span>
<span>bash: docker: command not found</span>
<span>----------------------------------------</span>
<span>i also get the following error when i try something else: </span>
<span>*---------------------------------------<span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot (205).png" style="width: 999px;"><img src="https://us.v-cdn.net/6038660/uploads/images/259162i9AB808890057B50B/Screenshot%20%28205%29.png" role="button" title="Screenshot (205).png" alt="Screenshot (205).png"></span></span>
I'm guessing docker is either not available in bitbucket, or i have something that's off in my bitbucket-pipelines.yml
Hi @Serge Asmar
Looks like you are missing the service definition.
Have a look here: https://support.atlassian.com/bitbucket-cloud/docs/run-docker-commands-in-bitbucket-pipelines/
Hello @Serge Asmar ,
Just adding to @Erez Maadani 's comment, in the first pipeline screenshot I'm seeing the error :
<span>The push refers to repository [<a href="http://docker.io/library/first_pipeline_img_build" rel="noopener nofollow noreferrer" target="_blank">docker.io/library/first_pipeline_img_build</a>]<br>[...]<br>denied: requested access to the resource is denied</span>
This is because when you built the docker image with docker build you provided the tag (-t) with just the image name but not the docker hub namespace where you want to push this image to. This makes docker default to library namespace, and your docker hub account doesn't seem to have access to that namespace/account.
In this case, I would recommend updating your docker build command to include the namespace/account into the tag, like the following example :
docker build -t mydockerhubuser/first_pipeline_img_build .
In the above example, we are using the docker hub account mydockerhubuser. This is the account under which the image will be pushed when you run a docker push.
Thank you, @Serge Asmar !
Patrik S!
Awesome thanks guys!
It looks like you're new here. Sign in or register to get started.