D
Danie Cilliers
To build on this further, if the option would exist where an image we built earlier in the pipeline could be used as environment for a job to run
The image is present especially with the setup_remote_docker setup. Would prefer this over building and using it at runtime as some images have options that need to be injected when built
Merged in a post:
Dockerfile as alternative to image for builds.
M
Maxcbc
Sometimes I want to use a custom base image for a build, but I don't want to go through the hassle of setting up a registry etc as this image will only be used locally on the ci machine and can be deleted periodically.
It'd be nice if I could specify a Dockerfile to build rather than an existing base image for my job in circle. The resulting image could then serve as a cache for apt-gets e.t.c.
CCI-I-477
J
Jim
+1. It would be great if I could have dockerfiles in my .circleci directory so the images are effectively part of my build configuration.
J
Jakob Heuser
Can this be achieved with the following lines already? The following works within a containerized docker build (using image docker:18.09-git)
steps:
- checkout
- setup_remote_docker
- run: |
docker build -t yourapp:${CIRCLE_SHA1} -f Dockerfile .
docker run -it yourapp:${CIRCLE_SHA1} <test_command>
N
Naftuli Kay
I'm very interested in this idea. I have a bunch of private repositories where I don't want or need to publish an image, but I need a customized build environment.
jdrydn
As mentioned here, this would be an excellent feature allowing us to easily customise & cache the base images. Shame it doesn't have more upvotes though.
In terms of implementation, I'd expect a similar configuration to how docker-compose references inline Dockerfiles:
jobs: build: docker: - build: dockerfile: ./.circleci/Dockerfile
Where the Dockerfile would look something like:
FROM circleci/node:8RUN sudo apt-get update && sudo apt-get install mysql-client