【问题标题】:Docker rootfs_linux.go permission denied when mounting /proc挂载/proc时Docker rootfs_linux.go权限被拒绝
【发布时间】:2023-03-19 09:25:03
【问题描述】:

我正在使用 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 用户和root 用户身份部署到我的LXD 容器,但这并没有帮助。这里显然有一些权限问题,但我不知道从哪里开始调试这个问题。

【问题讨论】:

    标签: docker meteor-up


    【解决方案1】:

    对于 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
    

    【讨论】:

      【解决方案2】:

      根据https://discuss.linuxcontainers.org/t/having-trouble-using-docker/383,听起来您可能需要设置security.nesting=true。停止容器 (lxc stop deploy-container),在 (lxc config set deploy-container security.nesting true 按照https://insights.ubuntu.com/2015/10/30/nested-containers-in-lxd) 和 lxc start deploy-container 上配置嵌套。

      【讨论】:

        猜你喜欢
        • 2016-03-30
        • 2020-09-07
        • 2019-02-13
        • 2023-03-22
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-06-05
        • 1970-01-01
        相关资源
        最近更新 更多