Hind Forsum
Hind Forsum

Reputation: 10527

docker daemon doesn't start in my ubuntu vm, "service start" ok by "ps" gives no result

I got a ubuntu 16.04 docker image started by docker already. I am trying the "embedded" docker, which means I tried to install docker inside this ubuntu. Seems the ubuntu docker image(latest) has some "bus" problem, as below:

root@xxxxxx:/# service docker start
 * Starting Docker: docker                                        [ OK ]
root@xxxxxx:/# ps -ef
UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  0 03:28 ?        00:00:00 bash
root     31797     1  0 08:53 ?        00:00:00 ps -ef
root@xxxxxx:/# docker --version
Docker version 17.03.0-ce, build 60ccb22

Why no process How to fix it and make it work?

Upvotes: 0

Views: 62

Answers (1)

BMitch
BMitch

Reputation: 264986

What you are trying to do is referred to as Docker in Docker, or dind. This is generally recommended against, if you simply want something like a Jenkins build slave that spins up docker containers, you would mount the docker socket or include a client certificate and spin up commands on the same docker host that is running the build slave.

If you really need dind, there is already an image for that. Included is a link to their github repo for the project.

Note that doing this requires that the container is run in privileged mode to give back access needed by docker to create containers, and you don't start docker as a service, you run dockerd in the foreground. The latter part about running in the foreground goes for any process you run.

Also note that you are not in a ubuntu VM, you are in a ubuntu container, and there is a very significant difference between the two. A container is a way to run an application isolated from other applications, while a VM is designed to abstract the physical hardware to run an entire OS that is isolated from any other OS running on the same hardware. Avoid treating your containers as lightweight VM's, this is an anti-pattern in docker.

Upvotes: 2

Related Questions