Ubuntu上的Docker hello-world-权限被拒绝 [英] Docker hello-world on Ubuntu - permission denied

查看:186
本文介绍了Ubuntu上的Docker hello-world-权限被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm trying to get docker (v 1.8.2) to work on Ubuntu 14_04, (using the -g option in the docker config file - Ubuntu is on a USB key and I got errors pulling images without using the disk of the machine). The result is that docker pulls the hello-world image but execution fails because of permissions. Any idea why and what I can do to fix it?

以下是命令和结果:

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

BTW,我已经一直想尝试在Linux上安装并运行docker的日子(我放弃了Mint 17之后切换到Ubuntu 14_04-在Windows 7上启动boot2docker并在同一台机器和网络上工作5分钟后)启动了USB键。我已经放弃尝试将docker文件存储在密钥本身上了(当我拉时,当拉实际到达那么远时,我会收到aufs安装错误)。所以现在我只是想让docker在某种配置下工作。

BTW, I've been trying for days to get docker installed and running on linux (I switched to Ubuntu 14_04 after giving up on Mint 17 - this after getting boot2docker on Windows 7 up and working in 5 min. on the same machine and network) booting off a USB key. I've given up on trying to store the docker files on the key itself (I get aufs mount errors when I pull, when the pull actually gets that far). So now I'm just trying to get docker working in some configuration.

更新:

我尝试了一些事情。我尝试使用chmods向docker存储目录添加权限。现在,使用以下命令无法加载映像:

I've tried a few things. I tried using chmods to add permissions to the docker storage dir. Now the image fails to load with the following:

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

I've also tried setting the options as follows in /etc/default/docker: DOCKER_OPTS="-g /cdrom/docker2 --storage-driver=devicemapper"

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

In the log (/var/log/upstart/docker.log) I see :

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

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

It's odd, because /cdrom (which is the mount for my USB key which contains Ubuntu) has 50GB available:

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


推荐答案

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

On Ubuntu 14.04 I keep having those errors. Fortunately, I updated the OS to 16.04 as per instruction details from docker website

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

In Ubuntu 14.04 the way of installation leads to errors like above mentioned. Try this after uninstalling the current version and then

sudo apt-get install docker-ce

要进行检查,请运行命令 docker run hello-world 。即使在此之后,后台驻留程序错误仍然发生,请参考官方码头工人文件

For checking run this, run the command docker run hello-world. If even after this, daemon error keep occurring, then refer to the official docker documentation

这篇关于Ubuntu上的Docker hello-world-权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆