-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support --build-arg
in docker-compose build
#3790
Labels
Milestone
Comments
--build-args
in docker-compose build
--build-arg
in docker-compose build
Hello, I wanted to learn docker-compose code and created one pull request to support this |
Closing via #4564 |
shin-
pushed a commit
that referenced
this issue
Feb 21, 2018
Currently, `docker-compose --build-arg` requires that a service be specified as part of the command-line invocation. So, $ docker-compose build --build-arg nocache=`git rev-parse @` foom works. However, when using out-of-band scripts to automate the build process of several Docker containers (in a CI system, for instance), it becomes difficult to specify exactly which service requires the build-arg. Docker has supported Dockerfiles that ignore build-args for a long time, so there is no problem is specifying spurious build-args to builds that don't consume it. The limitation on `docker-compose build` today is artificial, and there are no other commands that require specifying a service. Allow `--build-arg` to also match all services so this is possible: $ docker-compose build --build-arg nocache=`git rev-parse @` Please refer to #3790 for discussion on the original feature. Signed-off-by: Ramkumar Ramachandra <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Similarly to how Compose now supports the
run -e ENV_VAR=
option to mirror the behavior ofdocker
, it would be extremely useful for Compose to also supportbuild --build-arg ENV_VAR=
.This would fix some of the issues in #3608 ; without this option, it's very hard to use the
Dockerfile
's optionally overrideableARG
syntax (e.g.ARG=YOU_CAN_OVERRIDE_ME_WITH_BUILD_ARG
).One currently has to use the
docker-compose.yml
file'sargs:
option, which effectively either hard-codes the build argument or requires one to use a.env
file in conjunction that duplicates theDockerfile
's default argument.The text was updated successfully, but these errors were encountered: