How to mount a host directory in a Docker container

后端 未结 25 1601
庸人自扰
庸人自扰 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 13:24

    I've been having the same issue. My command line looked like this:

    docker run --rm -i --name $NAME -v `pwd`:/sources:z $NAME
    

    The problem was with 'pwd'. So I changed that to $(pwd):

    docker run --rm -i --name $NAME -v $(pwd):/sources:z $NAME
    

提交回复
热议问题