0

I have a simple Ubuntu 16.10 container which has docker.io installed.

The docker process terminates after it starts and log has this information. Any troubleshooting suggestions?

$ docker run -it --name dcos-ubuntu-python5 python-docker /bin/bash

root@5ff6bb6b6dc7:/# docker run hello-world
docker: Cannot connect to the Docker daemon. Is the docker daemon running on this host?.
See 'docker run --help'.

root@5ff6bb6b6dc7:/# service docker start
 * Starting Docker: docker                                                                                                                                          [ OK ]
root@5ff6bb6b6dc7:/# service docker status
 * Docker is not running

root@5ff6bb6b6dc7:/# tail -f /var/log/docker.log
time="2017-12-21T17:09:45.464736873Z" level=info msg="libcontainerd: new containerd process, pid: 50"
time="2017-12-21T17:09:46.472578239Z" level=fatal msg="Error starting daemon: error initializing graphdriver: operation not permitted"
mohan08p
  • 5,002
  • 1
  • 28
  • 36
Senthil Kumaran
  • 54,681
  • 14
  • 94
  • 131

3 Answers3

1

Why do you want to run docker within docker container?

Docker-in-Docker is developed to help docker development. And it needs --privileged flag to run docker container.(Please read jpetazzo's blog here.)

If you really want to execute docker in docker container, you also have other options.

  1. Bind mount docker.sock. Some people call this DooD(Docker-outside-of-Docker)

    docker run -v /var/run/docker.sock:/var/run/docker.sock ...

  2. Install docker(client) and specify DOCKER_HOST to access remote docker daemon. Be careful about socket protection with certificates.

SunghoMoon
  • 1,329
  • 1
  • 15
  • 21
0

Are you running docker as sudo if not run as sudo or

Else add user group to docker

docker group. For this run following command:

sudo usermod -aG docker $USER

sanath meti
  • 5,179
  • 1
  • 21
  • 30
0

The answer was simple.

docker run -it --privileged --name dcos-ubuntu-python5 python-docker /bin/bash

(This was also mentioned partly in @SunghoMoon's response. So Credits to him).

Senthil Kumaran
  • 54,681
  • 14
  • 94
  • 131