Build Docker image when using Docker base image [Pipelines] Edited

Hi there. I am using the newish Bitbucket Pipelines for my CI/CD flow.

I have compiled a base image based on amazonlinux:17.03 that resolves all of our dependencies, and allows us to inject new code to make a new build. I am serving it from Amazon's ECR

However, I would like to, after the build is completed, build a new docker image from the resulting environment and push it to the registry.

This does not seem to be supported, as the scripts get executed inside the initial docker image (which does not have docker installed; I'd like to avoid DinD if at all possible).

Whenever I attempt to perform a docker login to my registry, I get a `could not connect to docker daemon`, because the base image does not have docker installed (and nor should it).


And yes, I have docker enabled via options.


Is there a way to exit the base docker image/build process, and run the docker login/build/push steps on the build agent directly?

1 answer

Strangely enough, running docker version in my pipeline returns:

Client: Version: 1.12.6
API version: 1.24
Go version: go1.6.4
Git commit: 78d1802
Built: Wed Jan 11 00:23:16 2017
OS/Arch: linux/amd64
Cannot connect to the Docker daemon. Is the docker daemon running on this host?

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

31,147 views 26 12
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you