Came across a docker run command that uses -w flag.
docker run -v $(pwd):/project \
-w /project \
-p 8081:8081 \
gcr.io/base-project/myoh:v1
Any idea what the -w flag is for?
Came across a docker run command that uses -w flag.
docker run -v $(pwd):/project \
-w /project \
-p 8081:8081 \
gcr.io/base-project/myoh:v1
Any idea what the -w flag is for?
Just run docker run --help in your shell.
-w, --workdir string Working directory inside the container
Is used for set working directory (-w)
docker run -w /path/to/dir/ -i -t ubuntu pwd
The -w lets the command being executed inside directory given, here /path/to/dir/. If the path does not exist it is created inside the container.