Skip to content

Commit 259a3f8

Browse files
author
Matthew Fisher
committed
feat(using_dockerfiles): document build args feature flag
1 parent 2269596 commit 259a3f8

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

src/applications/using-dockerfiles.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,28 @@ Use `deis scale cmd=3` to increase `cmd` processes to 3, for example. Scaling a
122122
process type directly changes the number of [containers][container]
123123
running that process.
124124

125+
126+
## Docker Build Arguments
127+
128+
As of Workflow v2.13.0, users can inject their application config into the Docker image using
129+
[Docker build arguments][build-args]. To opt into this, users must add a new environment variable
130+
to their application:
131+
132+
```
133+
$ deis config:set DEIS_DOCKER_BUILD_ARGS_ENABLED=1
134+
```
135+
136+
Every environment variable set with `deis config:set` will then be available for use inside the
137+
user's Dockerfile. For example, if a user runs `deis config:set POWERED_BY=Workflow`,
138+
the user can utilize that build argument in their Dockerfile:
139+
140+
```
141+
ARG POWERED_BY
142+
RUN echo "Powered by $POWERED_BY" > /etc/motd
143+
```
144+
145+
146+
[build-args]: https://docs.docker.com/engine/reference/commandline/build/#set-build-time-variables---build-arg
125147
[container]: ../reference-guide/terms.md#container
126148
[controller]: ../understanding-workflow/components.md#controller
127149
[Dockerfile]: https://docs.docker.com/reference/builder/

0 commit comments

Comments
 (0)