- 현상 : docker run --volume='root_dir:docker_dir' docker_image 이후 docker shell에 접근하여 ls 수행 시 'ls: cannot open directory '.': Permission denied' 출력
- 원인 : docker 내부에서 root directory에 접근할 권한이 없음
- 해결 : 상당수는 --privileged=true 옵션을 사용하면 해결되었다고는 하지만, 보안 문제가 있을 수 있다고 하여 다른 방법을 찾아봄
stackoverflow.com/questions/24288616/permission-denied-on-accessing-host-directory-in-docker
Permission denied on accessing host directory in Docker
In short: I am trying to mount a host directory in Docker, but then I can not access it from within the container, even if the access permissions look good. The details: I am doing sudo docker r...
stackoverflow.com
찾아본 결과, docker run을 수행할 때, --volume="root_dir:docker_dir:z" 처럼 z를 추가해주면 된다고 함