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

时间:2015-09-12 09:01:06

标签: ubuntu docker

我正在尝试让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
顺便说一下,我已经尝试了几天来安装docker并在linux上运行(在放弃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(我的USB密钥的安装包含Ubuntu)有50GB可用:

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

1 个答案:

答案 0 :(得分:0)

在Ubuntu 14.04上,我一直遇到这些错误。幸运的是,我根据docker website

中的指令详细信息将操作系统更新为16.04。

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

sudo apt-get install docker-ce

要进行检查,请运行命令docker run hello-world。即使在此之后,如果仍然发生守护程序错误,请参考官方的docker documentation