File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -2043,25 +2043,25 @@ elsewhere. For example, consider this Dockerfile:
2043
2043
2044
2044
``` dockerfile
2045
2045
FROM busybox
2046
- USER ${user :-some_user}
2047
- ARG user
2048
- USER $user
2046
+ USER ${username :-some_user}
2047
+ ARG username
2048
+ USER $username
2049
2049
# ...
2050
2050
```
2051
2051
2052
2052
A user builds this file by calling:
2053
2053
2054
2054
``` console
2055
- $ docker build --build-arg user =what_user .
2055
+ $ docker build --build-arg username =what_user .
2056
2056
```
2057
2057
2058
- The ` USER ` at line 2 evaluates to ` some_user ` as the ` user ` variable is defined on the
2059
- subsequent line 3. The ` USER ` at line 4 evaluates to ` what_user ` as ` user ` is
2058
+ The ` USER ` at line 2 evaluates to ` some_user ` as the ` username ` variable is defined on the
2059
+ subsequent line 3. The ` USER ` at line 4 evaluates to ` what_user ` , as the ` username ` argument is
2060
2060
defined and the ` what_user ` value was passed on the command line. Prior to its definition by an
2061
2061
` ARG ` instruction, any use of a variable results in an empty string.
2062
2062
2063
2063
An ` ARG ` instruction goes out of scope at the end of the build
2064
- stage where it was defined. To use an arg in multiple stages, each stage must
2064
+ stage where it was defined. To use an argument in multiple stages, each stage must
2065
2065
include the ` ARG ` instruction.
2066
2066
2067
2067
``` dockerfile
You can’t perform that action at this time.
0 commit comments