Update WORKDIR command information

Signed-off-by: Govind Rai <raigovind93@gmail.com>
(cherry picked from commit e12aade595)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Govind Rai 2021-06-16 16:47:28 -07:00 committed by Sebastiaan van Stijn
parent c0e952cf04
commit 62d27c32ff
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
1 changed files with 5 additions and 0 deletions

View File

@ -1824,6 +1824,11 @@ RUN pwd
The output of the final `pwd` command in this `Dockerfile` would be The output of the final `pwd` command in this `Dockerfile` would be
`/path/$DIRNAME` `/path/$DIRNAME`
If not specified, the default working directory is `/`. In practice, if you aren't building a Dockerfile from scratch (`FROM scratch`),
the `WORKDIR` may likely be set by the base image you're using.
Therefore, to avoid unintended operations in unknown directories, it is best practice to set your `WORKDIR` explicitly.
## ARG ## ARG
```dockerfile ```dockerfile