Docker hello-world on Ubuntu - permission denied

2019-02-20 15:27发布

问题:

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?

Here's the command and the result:

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, 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.

Update:

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

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

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

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 docker