File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -1230,7 +1230,14 @@ The followings examples are all valid:
12301230### Working directory
12311231
12321232The default working directory for running binaries within a container is the
1233- root directory (` / ` ). It is possible to set a different working directory with the
1234- Dockerfile ` WORKDIR ` command. The operator can override this with:
1233+ root directory (` / ` ). The default working directory of an image is set using
1234+ the Dockerfile ` WORKDIR ` command. You can override the default working
1235+ directory for an image using the ` -w ` (or ` --workdir ` ) flag for the `docker
1236+ run` command:
12351237
1236- -w="", --workdir="": Working directory inside the container
1238+ ``` text
1239+ $ docker run --rm -w /my/workdir alpine pwd
1240+ /my/workdir
1241+ ```
1242+
1243+ If the directory doesn't already exist in the container, it will be created.
You can’t perform that action at this time.
0 commit comments