cloud66-oss/habitus

[Feature Request] pass Dockerfile build arguments in build.yml

adoyle-h opened this issue ยท 5 comments

I find the only way to pass Dockerfile build arguments is the --build parameter in CLI. Could you support the args keyword in build.yml (refer to docker-compose-file/#args)?

For example,

build:
  version: 2016-03-14 # version of the build schema.
  steps:
    builder:
      name: builder
      dockerfile: Dockerfile.builder
      args:
         host: 192.168.99.1
         secrets: true
         binding: 192.168.99.1

hi @adoyle-h! thanks for the feature request. The only way with the latest version is --build parameter in CLI indeed. I put this feature on the backlog, don't know yet when I have time to implement this. You can always build it yourself and send a PR.

@adoyle-h Sounds great! But a nit: maybe secrets: true and binding: 192.168.99.1 shouldn't be there as they re habitus' args rather than build args, right?

So, I guess what you wanted would be:

# NEW: matches to habitus -secret=true -host=192.168.99.1 -binding 192.168.99.1
# But this should be a separate feature request 
secrets: true
host: 192.168.99.1
binding: 192.168.99.1

build:
  version: 2016-03-14 # version of the build schema.
  steps:
    builder:
      name: builder
      dockerfile: Dockerfile.builder
      # NEW: for build-args, should be addressed in this issue
      args:
        MYARG: FOOBAR

Am I correct?

Anyway, support for buildargs via build.yaml would be awesome to have!
I am happy to contribute a PR once your original intention is confirmed or I have a enough confidence with my guess ๐Ÿ˜‰

@mumoshu You're right! Both build args for Dockerfile in each step and habitus' args for build flow. ๐Ÿ‘

Submitted #88 for this.