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

Build Docker image when using Docker base image [Pipelines]

ianseyer-mio August 3, 2017

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

0 votes
ianseyer-mio August 4, 2017

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
TAGS
AUG Leaders

Atlassian Community Events