docker-compose-buildkite-plugin icon indicating copy to clipboard operation
docker-compose-buildkite-plugin copied to clipboard

Allow volumes on build

Open natew opened this issue 4 years ago • 1 comments

Being able to mount a volume for build commands would allow doing some nice caching for things like node_modules with artifacts, I believe.

Alternatively, I think this PR would solve it another way: https://github.com/buildkite-plugins/docker-compose-buildkite-plugin/pull/271

natew avatar Mar 01 '21 18:03 natew

We would definitely make use of this. Our current workaround for this build images that need other images' data is to copy node_modules and Ruby gems installed in other images like this:

COPY --from=yarn /app/node_modules /app/node_modules

This works, but it's slower

geoffharcourt avatar Apr 03 '21 17:04 geoffharcourt

The docker documentation of the build command doesn't show an option to mount a volume at build time so there is no way to implement this in the plugin :(

Apparently, the right way to do this would be using multi-stage builds and COPY stanzas. Unless you are using buildkit, in which case most of the options to allow for this are to be added as part of the Dockerfile and not the command to execute the build.

Will close unless anyone can think of a way to help with this issue that is not related to buildkit (that is issue #256)

toote avatar Sep 22 '22 18:09 toote