0

Following my question here : I have a mesos slave (v1.7) on which I try to get a docker in docker running. When I am inside the container, I get the following error log :

$ cat /var/log/docker.log 
time="2015-10-17T12:27:40.963674511Z" level=fatal msg="Error starting daemon: error initializing graphdriver: operation not permitted" 

I can't find much info on internet, here are some similar questions:

  1. https://github.com/jpetazzo/dind/issues/89
  2. https://github.com/docker/docker/issues/14543
  3. Docker hello-world on Ubuntu - permission denied
Community
  • 1
  • 1
Romain Jouin
  • 4,448
  • 3
  • 49
  • 79

1 Answers1

0

So the graphdriver is the driver used to store your containers data/info/etc: (The graph)

More information here.

Looks like you don't have permissions to initialize the driver.

You can specify the directory where you want to store your graph and make sure that whichever user you are using to start your docker daemon has permissions to read/write to it. For example

$ docker daemon -D -g /<whatever>/<path>/<for_your_containers>

or (if you are using an older docker version)

$ docker -d -D -g /<whatever>/<path>/<for_your_containers>
Rico
  • 58,485
  • 12
  • 111
  • 141
  • I can not start the daemon [ # docker daemon -D ] => [docker: 'daemon' is not a docker command.] – Romain Jouin Nov 19 '15 at 13:39
  • @romainjouin you are using an older version of docker, try `docker -d ...` – Rico Nov 19 '15 at 15:22
  • what is suprising me is that I can start several containers on the same computer, and I can launch a simple command like : ["while [ true ] ; do echo 'Hello Marathon' ; sleep 5 ; done" ] on the cluster. Why is it half working ? – Romain Jouin Nov 19 '15 at 22:55
  • @romainjouin hard to tell Do you have a base image in your graph directory ? I'm making a wild guess but this command: `["while [ true ] ; do echo 'Hello Marathon' ; sleep 5 ; done" ]` happens in bash in memory with built in bash commands. Are most of your containers that run using those types of commands? The error could be when it tries to 'write' to the filesystem only. – Rico Nov 19 '15 at 23:02
  • I am starting my slave as root so I should have the right for writing wherever needed, no ? In fact I have a shell script doing a [docker run slave] , and I call this script through a [sudo script.sh] : I understand that commands in a script started by sudo will be executed as if the sudo user was executing each command, correct ? – Romain Jouin Nov 21 '15 at 14:28
  • oh but are restarting you docker daemon within a docker container? – Rico Nov 21 '15 at 23:55
  • I'm not sure I quite well understand you sentence :-s – Romain Jouin Nov 22 '15 at 22:11