Docker - cannot mount volume over existing file, file exists

后端 未结 3 1078
感动是毒
感动是毒 2021-02-07 08:30

I\'m trying to build a data container for my application in Docker. I run this command to expose some volumes:

docker run --name svenv.nl-data -v /etc/environmen         


        
3条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-07 09:14

    You should use:

    -v /etc/environment:/etc/environment
    

    instead of:

    -v /etc/environment
    

    The former maps container volume to the host volume. The latter tries to create a new volume at /etc/environment and fails since this directory already exists.

提交回复
热议问题