How to mount a host directory in a Docker container

后端 未结 25 1325
庸人自扰
庸人自扰 2020-11-22 12:43

I am trying to mount a host directory into a Docker container so that any updates done on the host is reflected into the Docker containers.

Where am I doing somethin

25条回答
  •  遇见更好的自我
    2020-11-22 12:59

    On Mac OS, to mount a folder /Users//projects/ on your mac at the root of your container:

    docker run -it -v /Users//projects/:/projects bash

    ls /projects

提交回复
热议问题