【docker】Docker容器中出现操作被拒绝解决方案
当我们在容器中执行某些命令是,可能会报下面的错误
ls: cannot access ‘./source’: Operation not permitted
1、查看docker的版本是否过低,
[root@localhost ~]# docker version
Client:
Version: 18.06.1-ce
API version: 1.38
Go version: go1.10.3
Git commit: e68fc7a
Built: Tue Aug 21 17:20:43 2018
OS/Arch: linux/amd64
Experimental: false
Server:
Engine:
Version: 18.06.1-ce
API version: 1.38 (minimum version 1.12)
Go version: go1.10.3
Git commit: e68fc7a
Built: Tue Aug 21 17:28:38 2018
OS/Arch: linux/amd64
Experimental: false
2、创建容器时,用超级管理员权限
docker run --name centos7V9 --privileged=true --network host -t -d centos:centos7.9.2009 /usr/sbin/init