Search code examples
dockerdocker-composedockerfiledocker-swarmdocker-machine

what is docker run -w flag?


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?


Solution

  • Just run docker run --help in your shell.

    -w, --workdir string Working directory inside the container

    https://docs.docker.com/engine/reference/run/#workdir