Build Docker Image then Use that Image?

I have a repository which needs only a handful of things. I’d like to simply create a Dockerfile in the root and have CircleCI build that Docker image and then use that Docker image for the remaining tasks in the pipeline.

Is there a way to have CircleCI docker build -t naftulikay/myrepo:latest and then use that built image locally for subsequent steps?

Not currently, but we have a feature request here https://circleci.com/ideas/?idea=CCI-I-130

Please vote to show interest and track updates and feel free to comment to add thoughts or clarify.

1 Like

I think this is possible already - just make it two projects (i.e. two jobs). The thing that builds your build image and what you do with it are two separate tasks - the first is CI tooling and the second is your project under CI. When building your build image, push it to a private registry, and when doing the rest of your pipeline, pull the image from the private registry.

2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.