1

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
aro_tech
  • 1,103
  • 7
  • 20
  • Not sure if it's related to [this question](http://stackoverflow.com/questions/30248794/run-docker-in-ubuntu-live-disk?rq=1) -- I will have to look into it when I get the chance. – aro_tech Sep 12 '15 at 18:10
  • Tried it - did not work, as explained in the update. – aro_tech Sep 13 '15 at 07:00
  • 1
    Does it work (albeit slowly) if you use the "vfs" storage driver? (Which is really no storage driver at all...) – Adrian Mouat Sep 13 '15 at 13:28
  • Thanks, @AdrianMouat -- Unfortunately I get the following error with vfs: Error response from daemon: symlink /proc/mounts /cdrom/docker3/vfs/dir/9034eb7354ade3d329bb795778e098e3d5f1b1b684c0c6a776aa3d057864fdc8-init/etc/mtab: operation not permitted – aro_tech Sep 14 '15 at 00:40
  • @AdrianMouat -- I tried again today using the internal hard disk and vfs, and hello-world worked! Thanks for the idea. This solves part of my problem, at least. The hello-world was not slow, but doing a big pull seems to slow my Ubuntu to a crawl, leaving docker-untar processes running. – aro_tech Sep 14 '15 at 22:37
  • Another strange thing happened when I used vfs. When I did a big pull (only a few 100s of MB in virtual image size but taking up gigabytes of disk), Ubuntu seems to have unmounted the internal hard disk and mounted a virtual disk in its place in the usb key's casper-rw file. The casper-rw file is the virtual partition limited to 4GB, and it's full after pulling just a couple of the images I need. Seems I need to either expand the casper partition with a real partition of the USB key or install Ubuntu on a partition of the internal hard disk. – aro_tech Sep 14 '15 at 23:57
  • VFS isn't CoW, so each container will need a full copy of the image - that's probably the main problem. – Adrian Mouat Sep 15 '15 at 07:37

2 Answers2

0

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

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

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

B--rian
  • 5,578
  • 10
  • 38
  • 89
MathanKumar
  • 543
  • 1
  • 4
  • 17
0

you can use

sudo su

or Got permission denied while trying to connect to the Docker daemon socket at unix try this command

sudo usermod -aG docker ubuntu
sudo usermod -aG root ubuntu
sudo chmod 777 /var/run/docker.sock
sudo reboot