How to mount a host directory in a Docker container

后端 未结 25 1598
庸人自扰
庸人自扰 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条回答
  •  -上瘾入骨i
    2020-11-22 13:20

    docker run -v /host/directory:/container/directory -t IMAGE-NAME /bin/bash
    
    docker run -v /root/shareData:/home/shareData -t kylemanna/openvpn /bin/bash
    

    In my system I've corrected the answer from nhjk, it works flawless when you add the -t flag.

提交回复
热议问题