Skip to content

Commit 43dda63

Browse files
committed
docs: rewrite section on working directory
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
1 parent 9f39693 commit 43dda63

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

docs/reference/run.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,7 +1341,13 @@ The followings examples are all valid:
13411341
### Working directory
13421342

13431343
The default working directory for running binaries within a container is the
1344-
root directory (`/`). It is possible to set a different working directory with the
1345-
Dockerfile `WORKDIR` command. The operator can override this with:
1344+
root directory (`/`). The default working directory of an image is set using
1345+
the Dockerfile `WORKDIR` command. You can override the default working
1346+
directory for an image using the `-w` (or `--workdir`) flag for the `docker
1347+
run` command:
13461348

1347-
-w="", --workdir="": Working directory inside the container
1349+
```text
1350+
$ docker run -w /home/$USER -it alpine
1351+
```
1352+
1353+
If the directory doesn't already exist in the container, it will be created.

0 commit comments

Comments
 (0)