What is happening when using ../ with docker-compose volume

前端 未结 2 855
天命终不由人
天命终不由人 2021-02-08 01:51

I am having problems with writing files out from inside a docker container to my host computer. I believe this is a privilege issue and prefer not to set privileged: True<

2条回答
  •  别那么骄傲
    2021-02-08 02:47

    The statement volumes: ['../:/example'] makes the parent directory of the directory containing docker-compose.yml on the host (../) visible inside the container at /example. Host directory bind-mounts like this, plus some equivalent constructs using a named volume attached to a specific host directory, are the only way a container can write out to the host filesystem.

提交回复
热议问题