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"
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.
Bind mount docker.sock. Some people call this DooD(Docker-outside-of-Docker)
docker run -v /var/run/docker.sock:/var/run/docker.sock ...
Install docker(client) and specify DOCKER_HOST
to access remote docker daemon. Be careful about socket protection with certificates.