mirror of https://github.com/docker/docs.git
parent
559f0a1edd
commit
9ba5248f1e
|
@ -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.
|
||||||
|
|
Loading…
Reference in New Issue