Fix #5219: Change unsafe ARG example in compose file docs. (#5984)

This commit is contained in:
Björn 2018-03-17 19:22:19 +01:00 committed by Gwendolynne Barr
parent 559f0a1edd
commit 9ba5248f1e
1 changed files with 6 additions and 6 deletions

View File

@ -165,32 +165,32 @@ build process.
First, specify the arguments in your Dockerfile: First, specify the arguments in your Dockerfile:
ARG buildno ARG buildno
ARG password ARG gitcommithash
RUN echo "Build number: $buildno" RUN echo "Build number: $buildno"
RUN script-requiring-password.sh "$password" RUN echo "Based on commit: $gitcommithash"
Then specify the arguments under the `build` key. You can pass either a mapping Then specify the arguments under the `build` key. You can pass a mapping
or a list: or a list:
build: build:
context: . context: .
args: args:
buildno: 1 buildno: 1
password: secret gitcommithash: cdc3b19
build: build:
context: . context: .
args: args:
- buildno=1 - buildno=1
- password=secret - gitcommithash=cdc3b19
You can omit the value when specifying a build argument, in which case its value You can omit the value when specifying a build argument, in which case its value
at build time is the value in the environment where Compose is running. at build time is the value in the environment where Compose is running.
args: args:
- buildno - buildno
- password - gitcommithash
> **Note**: YAML boolean values (`true`, `false`, `yes`, `no`, `on`, `off`) must > **Note**: YAML boolean values (`true`, `false`, `yes`, `no`, `on`, `off`) must
> be enclosed in quotes, so that the parser interprets them as strings. > be enclosed in quotes, so that the parser interprets them as strings.