【问题标题】:docker run hello-world still fails, permission denieddocker run hello-world 仍然失败,权限被拒绝
【发布时间】:2017-01-26 05:20:45
【问题描述】:

我正在尝试运行 docker,但它仍然失败。这是我得到的

root@c1170137:~# docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world

c04b14da8d14: Extracting    974 B/974 B
docker: failed to register layer: ApplyLayer exit status 1 stdout:  stderr: permission denied.
See 'docker run --help'.

内核:4.4.16-1-pve

我正在使用 debian jessie

Distributor ID: Debian
Description:    Debian GNU/Linux 8.5 (jessie)
Release:        8.5
Codename:       jessie

编辑: 守护进程日志 http://hastebin.com/qinufacuto.coffee

码头工人信息

root@c1177124:~# docker info
Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 0
Server Version: 1.12.1
Storage Driver: vfs
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: host bridge null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options:
Kernel Version: 4.4.16-1-pve
Operating System: Debian GNU/Linux 8 (jessie)
OSType: linux
Architecture: x86_64
CPUs: 32
Total Memory: 2 GiB
Name: c1177124
ID: 4YUJ:OL2E:WLJC:23WJ:5HRW:LRY3:QHKC:MKXO:JDWO:VWOQ:JMWN:V52W
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled
Insecure Registries:
 127.0.0.0/8

顺便说一句,问题可能是由内核引起的。 感谢您的任何想法或解决方案

【问题讨论】:

  • 你能运行带有docker -D调试标志的命令并粘贴输出吗?
  • @nash_ag 像这样? root@c1177124:~# docker -D run hello-world Unable to find image 'hello-world:latest' locally latest: Pulling from library/hello-world c04b14da8d14: Extracting 974 B/974 B docker: failed to register layer: ApplyLayer exit status 1 stdout: stderr: permission denied. See 'docker run --help'.
  • 将 daemon.log 添加到帖子中
  • 另加docker info
  • @Alkaline 是的,已添加

标签: linux docker debian


【解决方案1】:

使用lxc.apparmor.profile: unconfined

只需放在 /etc/pve/lxc/ID.conf 文件的末尾并重新启动您的 LXC 容器。

不推荐使用lxc.aa_profile: unconfined,因为已重命名。

【讨论】:

  • 如果我没有 /etc/pve/lxc/.conf 文件怎么办?
【解决方案2】:

如果您不关心安全性或不信任您的 docker 容器:

  1. /etc/pve/lxc/ID.conf 中的主机上编辑lxc 容器的配置文件,在文件末尾添加lxc.aa_profile: unconfined
  2. 删除apparmor:apt-get remove apparmor --purge

【讨论】:

  • 完美地为 Proxmox 工作是在 Proxmox 覆盖特定的 lxc 设置时遇到问题,使用特定的 Proxmox 配置修复了所有问题,谢谢!
  • 已弃用。请改用lxc.apparmor.profile: unconfined。只需放在 ID.conf 文件的末尾并重新启动您的 LXC 容器。
  • 移除 apparmor 就像把车门一起从车上拆下来,因为有一天你必须把咖啡放下,这样你才能腾出一只手来打开它。 @AndreyVolk,你能把它放在自己的答案中,这样我就可以正确投票了吗?
  • 当您卡住已移除的应用程序时,请按照安装说明pve.proxmox.com/wiki/Install_Proxmox_VE_on_Debian_Stretch 和 apt-installl proxmox-ve
【解决方案3】:

Iam 通过在 Host 上执行此命令解决了这个问题:

lxc config set your-lxc-name security.nesting true

lxc config set your-lxc-name security.privileged true

【讨论】:

    【解决方案4】:

    我有同样的错误。就我而言,这是由于 McAfee 防病毒软件造成的。我将其删除,然后成功拉动。 McAffe 阻止了 /etc/passwd 文件夹,Docker 无法提取图像。

    这里的人们遇到了同样的问题: https://github.com/moby/moby/issues/37817

    【讨论】:

      猜你喜欢
      • 2019-07-28
      • 2020-07-21
      • 1970-01-01
      • 1970-01-01
      • 2020-01-03
      • 1970-01-01
      • 1970-01-01
      • 2016-01-29
      • 2013-06-12
      相关资源
      最近更新 更多