gpt4 book ai didi

ubuntu - Ubuntu 上的 Docker hello-world - 权限被拒绝

转载 作者:行者123 更新时间:2023-12-02 20:26:23 25 4
gpt4 key购买 nike

我正在尝试让 docker(v 1.8.2)在 Ubuntu 14_04 上工作(使用 docker 配置文件中的 -g 选项 - Ubuntu 在 USB key 上,并且在不使用机器磁盘的情况下提取图像时出错)。结果是 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 key 。我已经放弃尝试将 docker 文件存储在 key 本身上(当我拉动时,我得到 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(这是我的 USB key 的挂载,包含 Ubuntu)有 50GB 可用:
/dev/sdb1        59G  9.1G   50G  16% /cdrom

最佳答案

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

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

sudo apt-get install docker-ce

要检查运行这个,运行命令 docker run hello-world .如果即使在这之后,守护进程错误仍然发生,那么请引用官方 docker documentation

关于ubuntu - Ubuntu 上的 Docker hello-world - 权限被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32537037/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com