Skip to content
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

Allow buildargs for multi-service builds #5698

Merged
merged 2 commits into from
Feb 22, 2018
Merged

Conversation

shin-
Copy link

@shin- shin- commented Feb 21, 2018

Based on #5213
Fixes #5213

artagnon and others added 2 commits February 21, 2018 15:24
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 <artagnon@gmail.com>
Add buildarg tests

Signed-off-by: Joffrey F <joffrey@docker.com>
@shin- shin- added this to the 1.20.0 milestone Feb 21, 2018
@shin- shin- merged commit cd3ffe6 into master Feb 22, 2018
@shin- shin- deleted the artagnon-build-args-services branch February 28, 2018 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants