2

I am tyring to install docker inside a docker container, so i pulled a centos7 image and enabled systemd in it.

So i created a container from the image and then tried to install docker in it.

However for some reasons i am not able to start the docker service, Here is output of the commands from the container

systemctl start docker

Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.

systemctl status docker

● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/docker.service.d
           └─override.conf
   Active: failed (Result: exit-code) since Tue 2020-12-15 10:27:16 UTC; 23s ago
     Docs: https://docs.docker.com
  Process: 574 ExecStart=/usr/sbin/dockerd -H unix:// $DOCKER_OPTS (code=exited, status=203/EXEC)
 Main PID: 574 (code=exited, status=203/EXEC)

Dec 15 10:27:16 c16893d50c15 systemd[1]: docker.service: Service RestartSec=2s expired, scheduling restart.
Dec 15 10:27:16 c16893d50c15 systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
Dec 15 10:27:16 c16893d50c15 systemd[1]: Stopped Docker Application Container Engine.
Dec 15 10:27:16 c16893d50c15 systemd[1]: docker.service: Start request repeated too quickly.
Dec 15 10:27:16 c16893d50c15 systemd[1]: docker.service: Failed with result 'exit-code'.
Dec 15 10:27:16 c16893d50c15 systemd[1]: Failed to start Docker Application Container Engine.

dockerd --debug

INFO[2020-12-15T10:28:08.589710537Z] Starting up
DEBU[2020-12-15T10:28:08.590585826Z] Listener created for HTTP on unix (/var/run/docker.sock)
DEBU[2020-12-15T10:28:08.591290544Z] Golang's threads limit set to 56070
INFO[2020-12-15T10:28:08.591784686Z] parsed scheme: "unix" module=grpc
INFO[2020-12-15T10:28:08.591807273Z] scheme "unix" not registered, fallback to default scheme module=grpc
DEBU[2020-12-15T10:28:08.591814663Z] metrics API listening on /var/run/docker/metrics.sock
INFO[2020-12-15T10:28:08.591843833Z] ccResolverWrapper: sending update to cc: [{unix:///run/containerd/containerd.sock  <nil> 0 <nil>}] <nil> <nil>}  module=grpc
INFO[2020-12-15T10:28:08.591955801Z] ClientConn switching balancer to "pick_first"  module=grpc
INFO[2020-12-15T10:28:08.593614061Z] parsed scheme: "unix"                         module=grpc
INFO[2020-12-15T10:28:08.593646287Z] scheme "unix" not registered, fallback to default scheme  module=grpc
INFO[2020-12-15T10:28:08.593672812Z] ccResolverWrapper: sending update to cc: {[{unix:///run/containerd/containerd.sock  <nil> 0 <nil>}] <nil> <nil>}  module=grpc
INFO[2020-12-15T10:28:08.593683296Z] ClientConn switching balancer to "pick_first"  module=grpc
DEBU[2020-12-15T10:28:08.594523308Z] Using default logging driver json-file
DEBU[2020-12-15T10:28:08.594622712Z] [graphdriver] priority list: [btrfs zfs overlay2 fuse-overlayfs aufs overlay devicemapper vfs]
DEBU[2020-12-15T10:28:08.594661302Z] processing event stream                       module=libcontainerd namespace=plugins.moby
DEBU[2020-12-15T10:28:08.604556675Z] backingFs=xfs, projectQuotaSupported=false, indexOff="index=off,"  storage-driver=overlay2
INFO[2020-12-15T10:28:08.604588162Z] [graphdriver] using prior storage driver: overlay2
DEBU[2020-12-15T10:28:08.604606372Z] Initialized graph driver overlay2
DEBU[2020-12-15T10:28:08.610134017Z] No quota support for local volumes in /var/lib/docker/volumes: Filesystem does not support, or has not enabled quotas
DEBU[2020-12-15T10:28:09.564927998Z] Cleaning up old mountid : start.
failed to start daemon: error while opening volume store metadata database: timeout

docker info

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Build with BuildKit (Docker Inc., v0.5.0-docker)

Server:
ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
errors pretty printing info
Haryvar
  • 23
  • 5
  • Running Docker in Docker is technically a little tricky, and is usually discouraged. What's your eventual goal? Why not use the prebuilt `docker:dind` image? – David Maze Dec 15 '20 at 11:04
  • @DavidMaze yes that's correct it is tricky i too got to understand since past two days, well the goal is to have centos7 with docker and use it for a various use cases... i have a vm with similar setup but now trying to replicate it as a container – Haryvar Dec 15 '20 at 11:10
  • Use the working VM. It might be helpful to think of a container as a wrapper around a single process; if you want "CentOS" and "various use cases" and not some specific application, a VM is a better match. (Systemd and Docker also don't play nicely, and I'd recommend avoiding systemd if at all possible.) – David Maze Dec 15 '20 at 11:32
  • `--privilege` option might enable this, but I don't recommend. Only wanna let container run on container, [containerd](https://containerd.io/) might be good choice. – Akihito KIRISAKI Dec 15 '20 at 12:13
  • @AkihitoKIRISAKI --privilege i used to create and run container with --privilege option, but still it did not work for me. – Haryvar Dec 15 '20 at 13:31

0 Answers0