deis / builder

Git server and application builder for Deis Workflow
https://deis.com
MIT License
40 stars 44 forks source link

Proposal: Pass config variables as build arguments into Docker builds #479

Closed jayjun closed 7 years ago

jayjun commented 7 years ago

As discussed in #450, config variables are passed as environment variables during build-time to buildpacks, but the same doesn't happen for Dockerfile deploys. In other words, we can't parameterise Docker builds.

The ARG primitive and --build-arg flag were introduced to pass build-time environment variables.

$ deis config:set CREDS=s3cr3t
ARG CREDS
RUN echo $CREDS > creds.txt && proxy -creds=creds.txt

I propose mapping config variables to Docker build-time variables to mirror buildpack behaviour.

bacongobbler commented 7 years ago

See https://github.com/deis/builder/pull/478 and https://github.com/deis/dockerbuilder/pull/114.

Akshaykapoor commented 7 years ago

It'll be good to have this. @bacongobbler when do you think it can be merged

bacongobbler commented 7 years ago

I don't have time to bring them past the finish line. Feel free to take it up!

ApsOps commented 7 years ago

Should be fixed by #478 , #488 and https://github.com/deis/dockerbuilder/pull/114, https://github.com/deis/dockerbuilder/pull/117