Merge pull request #3142 from govindrai/patch-1

Add information on WORKDIR
This commit is contained in:
Sebastiaan van Stijn 2021-12-08 11:41:54 +01:00 committed by GitHub
commit 5e0f1b9dcc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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
`/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
```dockerfile