卷装入时拒绝Docker权限

时间:2017-11-08 10:41:10

标签: docker docker-compose dockerfile

由于权限问题,我无法在docker-compose上装载卷。

ERROR: for [container]  Cannot start service [container]: oci runtime error: container_linux.go:295: starting container process caused "process_linux.go:399: container init caused \"rootfs_linux.go:57: mounting \\\"[path]\\\" to rootfs \\\"/var/lib/docker/100000.100000/overlay2/cf20e69e439cb7bfe21e805359a4b2bc48efcc7d04282d4b3e594679c6fef36a/merged\\\" at \\\"[path]\\\" caused \\\"stat [path]: permission denied\\\"\""

配置:

  • Ubuntu 17.10加密磁盘
  • Docker version 17.10.0-ce, build f4ffd25
  • docker-compose version 1.16.1, build 6d1ac21

Docker-compose:

container:
  build:
    context: ./container
  volumes:
      #WORK  - "/tmp/:/tmp/"
      #DO NOT WORK  - "./container/src:/usr/src/app/src"

1 个答案:

答案 0 :(得分:1)

好的我明白了,/home/user文件夹没有足够的权限。

    $ ls -adl /home/user/
drwx------ 36 user user 12288 nov.   8 14:19 /home/user/

使用chmod

修正了它
chmod a+rwx /home/user/
chmod a+rw /var/run/docker.sock