Docker rootfs_linux.go 安装 /proc 时权限被拒绝

Docker rootfs_linux.go permission denied when mounting /proc

我正在使用 meteor-up 部署到 LXD 容器内的 docker 个实例。当它尝试启动 MongoDB docker 实例时,它失败并出现以下错误:

docker: Error response from daemon: oci runtime error: container_linux.go:265: starting container process caused "process_linux.go:368: container init caused \"rootfs_linux.go:57: mounting \\"proc\\" to rootfs \\"/var/lib/docker/vfs/dir/20a621a73755db3f4030bc67bbf7ff9540bd1d63bb348d8be440d8ca63d3c922\\" at \\"/proc\\" caused \\"permission denied\\"\"".

我已经尝试以 ubuntu 用户身份部署到我的 LXD 容器,并以 root 用户身份部署,但没有帮助。显然这里有一些权限问题,但我不知道从哪里开始调试这个问题。

根据 https://discuss.linuxcontainers.org/t/having-trouble-using-docker/383 it sounds like you might need to set security.nesting=true. Stop the container (lxc stop deploy-container), configure nesting on (lxc config set deploy-container security.nesting true as per https://insights.ubuntu.com/2015/10/30/nested-containers-in-lxd) 和 lxc start deploy-container.

对于 Proxmox 用户:https://www.youtube.com/watch?v=79KiCBNbsbg

在容器上启用 Nesting 功能以修复以下错误

ERROR: for mysql-8.0  Cannot start service mysql-8.0:
failed to create shim: OCI runtime create failed:
container_linux.go:380: starting container process caused: process_linux.go:545:
container init caused: rootfs_linux.go:76: mounting "proc" to rootfs at
"/proc" caused: mount through procfd: permission denied: unknown

但其他用户 Proxmox users say 也要启用 keyctl

如果仍然有错误,您可能需要从 docker-compose 配置中删除 domain_namehostname 以修复以下错误,如 here 所述。

ERROR: for mariadb10-4  Cannot start service mariadb10-4: failed to create shim: OCI runtime create failed: container_linux.go:380:
starting container process caused: process_linux.go:545:
container init caused: write sysctl key kernel.domainname:
open /proc/sys/kernel/domainname: permission denied: unknown