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

标签 ubuntu docker

我正在尝试让 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/

相关文章:

linux - Windows 10 上的 VMWare Workstation 11 以 32 位执行,无法启动 Ubuntu Linux 64 位客户机

volume - Docker Volumes - 自动添加文件

ubuntu - 当我尝试在 .bashrc 中添加命令时找不到命令消息

python - 未知协议(protocol)类型 : 'file' : I keep getting an error while creating a Virtual Machine in vert-manager on Ubuntu

ubuntu - SSH使用pem文件询问密码

mysql - 在 Ubuntu 8.04 上重启 mysql 的更好脚本

docker 机器 vs docker for mac

apache-spark - 如何在DockerFile中一次定义我的ENV变量并将其传递给我的有监督托管脚本提交的spark镜像?

docker - 使用Docker的Nginx配置出现问题

docker - 在 ubuntu : unable to connect to github. com 上安装 docker