Motivation for this proposal
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
Motivation for this proposal
environmentsection isn't applied during the build phaseProposal
Move all build related configuration into a
build:section in the service. ExampleThis 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
buildanddockerfilewould still be allowed at the top level of the service definition. Adockerfileat the top level would print a deprecation warning.On the following release
dockerfileat the top level of the service definition would be removed, and it must be under thebuildsection. For trivial cases, a config ofbuild: path/to/contextwould still be supported.Related #2111