Proposal: new build config section
Motivation for this proposal
- https://github.com/docker/docker/pull/15182 will be in 1.9.0 allow for build args
- new users are often confused when the
environmentsection isn't applied during the build phase
Proposal
Move all build related configuration into a build: section in the service. Example
web:
build:
context: .
dockerfile: Dockerfile.name
args:
key: value
...
This should help clarify the fields that are related to the build phase (and the fields that are not).
Backwards compatibility
On the first release both build and dockerfile would still be allowed at the top level of the service definition. A dockerfile at the top level would print a deprecation warning.
On the following release dockerfile at the top level of the service definition would be removed, and it must be under the build section. For trivial cases, a config of build: path/to/context would still be supported.
Related #2111
I like this approach, sgtm. For the deprecation of the top-level fields; perhaps Compose should add a deprecation policy similar to Engine; https://github.com/docker/docker/blob/master/docs/misc/deprecated.md. This gives users time to adapt, and a clear notice when a feature will be removed,
+1 can't wait... :dancer:
:+1:
:+1:
is this option was added to docker-compose? the support for build-args?
:+1:
:+1:
Working on this in #2540
+1
Merged in #2653, carried from #2540
Thanks everyone! :+1: Can't wait for this release!
+1 Really need --build-arg capability with docker-compose!! Will be MOST GLAD when it is added and released!
@ericm24 +1 :) Can't wait too! :)