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 Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

638 views 0 4
Read article

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot