compose icon indicating copy to clipboard operation
compose copied to clipboard

Proposal: new build config section

Open dnephin opened this issue 11 years ago • 13 comments

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 environment section 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

dnephin avatar Oct 09 '15 00:10 dnephin

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,

thaJeztah avatar Oct 10 '15 19:10 thaJeztah

+1 can't wait... :dancer:

blaggacao avatar Nov 10 '15 15:11 blaggacao

:+1:

mosop avatar Nov 15 '15 07:11 mosop

:+1:

marcellodesales avatar Nov 17 '15 04:11 marcellodesales

is this option was added to docker-compose? the support for build-args?

lechen26 avatar Nov 30 '15 13:11 lechen26

:+1:

Silex avatar Dec 03 '15 15:12 Silex

:+1:

ducva avatar Dec 07 '15 21:12 ducva

Working on this in #2540

garrettheel avatar Dec 14 '15 01:12 garrettheel

+1

levivm avatar Dec 24 '15 02:12 levivm

Merged in #2653, carried from #2540

dnephin avatar Jan 14 '16 23:01 dnephin

Thanks everyone! :+1: Can't wait for this release!

marcellodesales avatar Jan 15 '16 00:01 marcellodesales

+1 Really need --build-arg capability with docker-compose!! Will be MOST GLAD when it is added and released!

ericm24 avatar Jan 18 '16 19:01 ericm24

@ericm24 +1 :) Can't wait too! :)

marcellodesales avatar Jan 20 '16 08:01 marcellodesales