【问题标题】:Docker hello-world on Ubuntu - permission deniedUbuntu 上的 Docker hello-world - 权限被拒绝
【发布时间】:2019-08-16 18:05:46
【问题描述】:

我正在尝试让 docker (v 1.8.2) 在 Ubuntu 14_04 上工作,(使用 docker 配置文件中的 -g 选项 - Ubuntu 在 USB 密钥上,并且在不使用磁盘的情况下提取图像时出错机器)。结果是 docker 拉取了 hello-world 镜像,但由于权限问题,执行失败。知道为什么以及我能做些什么来解决它吗?

这是命令和结果:

ubuntu@ubuntu:~$ sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
535020c3e8ad: Pull complete 
af340544ed62: Pull complete 
library/hello-world:latest: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security.
Digest: sha256:02fee8c3220ba806531f606525eceb83f4feb654f62b207191b1c9209188dedd
Status: Downloaded newer image for hello-world:latest
exec: "/hello": permission denied
Error response from daemon: Cannot start container d16115c24bfdf2183a2f5e9abe2c570b85e9edd01f957dbed5f7a084680e42b5: [8] System error: exec: "/hello": permission denied

顺便说一句,我几天来一直在尝试在 linux 上安装和运行 docker(我在放弃 Mint 17 后切换到 Ubuntu 14_04 - 这是在 Windows 7 上启动 boot2docker 并在 5 分钟内工作之后。在同一机器和网络)从 USB 密钥启动。我已经放弃尝试将 docker 文件存储在密钥本身上(当我拉动时,我得到 aufs 安装错误,而当拉动实际上达到那么远时)。所以现在我只是想让 docker 在一些配置中工作。

更新:

我已经尝试了一些方法。我尝试使用 chmods 向 docker 存储目录添加权限。现在图像无法加载以下内容:

Error response from daemon: error creating aufs mount to /media/ubuntu/D2CECE16CECDF2B1/docker/aufs/mnt/b43408232092aae0fd14e859732b4cf680db108932dab332d5a75fe2d4bd61f2-init: invalid argument

我还尝试在 /etc/default/docker 中设置如下选项: DOCKER_OPTS="-g /cdrom/docker2 --storage-driver=devicemapper"

在日志中 (/var/log/upstart/docker.log) 我看到了:

FATA[0000] Error starting daemon: error initializing graphdriver: truncate /cdrom/docker2/devicemapper/devicemapper/data: file too large

这很奇怪,因为 /cdrom(这是我的包含 Ubuntu 的 USB 密钥的挂载)有 50GB 可用:

/dev/sdb1        59G  9.1G   50G  16% /cdrom

【问题讨论】:

  • 不确定它是否与this question 相关——有机会我会调查一下。
  • 试过了 - 没用,如更新中所述。
  • 如果您使用“vfs”存储驱动程序,它是否工作(虽然速度很慢)? (这根本不是存储驱动程序......)
  • 谢谢,@AdrianMouat -- 不幸的是,我收到以下 vfs 错误:来自守护进程的错误响应:symlink /proc/mounts /cdrom/docker3/vfs/dir/9034eb7354ade3d329bb795778e098e3d5f1b1b684c0c6a776aa3d057864fdc8-init/etc不允许操作
  • @AdrianMouat -- 今天我再次尝试使用内部硬盘和 vfs,hello-world 成功了!谢谢你的主意。这至少解决了我的部分问题。 hello-world 并不慢,但是做一个大的拉动似乎会让我的 Ubuntu 慢下来,让 docker-untar 进程继续运行。

标签: ubuntu docker


【解决方案1】:

在 Ubuntu 14.04 上,我一直遇到这些错误。幸运的是,我根据docker website 的指令详细信息将操作系统更新到了 16.04

在 Ubuntu 14.04 中,安装方式会导致上述错误。 卸载当前版本后再试试这个

sudo apt-get install docker-ce

为了检查运行这个,运行命令docker run hello-world。如果在这之后,daemon error一直出现,请参考官方docker documentation

【讨论】:

    猜你喜欢
    • 2020-07-21
    • 2019-07-28
    • 1970-01-01
    • 2017-01-26
    • 2019-08-19
    • 2018-07-15
    • 2013-06-12
    • 2023-03-22
    • 1970-01-01
    相关资源
    最近更新 更多