From 9ba5248f1e7b1e8acc5cac353eb71da17636a1e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn?= Date: Sat, 17 Mar 2018 19:22:19 +0100 Subject: [PATCH] Fix #5219: Change unsafe ARG example in compose file docs. (#5984) --- compose/compose-file/compose-file-v2.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/compose/compose-file/compose-file-v2.md b/compose/compose-file/compose-file-v2.md index 4c1e42e24f..46e534e9e6 100644 --- a/compose/compose-file/compose-file-v2.md +++ b/compose/compose-file/compose-file-v2.md @@ -165,32 +165,32 @@ build process. First, specify the arguments in your Dockerfile: ARG buildno - ARG password + ARG gitcommithash 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: build: context: . args: buildno: 1 - password: secret + gitcommithash: cdc3b19 build: context: . args: - buildno=1 - - password=secret + - gitcommithash=cdc3b19 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. args: - buildno - - password + - gitcommithash > **Note**: YAML boolean values (`true`, `false`, `yes`, `no`, `on`, `off`) must > be enclosed in quotes, so that the parser interprets them as strings.