0

I am trying to install Docker inside a virtual machine running debian stretch that i was provided access to by my company. Searching through forums i read many posts claiming this is working out-of-the-box.

However when following installation guides (i tried the official docker installation guide for debian as well as a docker installation guide from digitalocean getting the same results) i run into the same errors everytime when i install docker-ce with apt.

Error looks like the following (sorry, the system has german localization):

update-alternatives: Warnung: Neuinstallation der Alternative /usr/bin/dockerd-ce ist erzwungen, weil Linkgruppe dockerd defekt ist
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.
invoke-rc.d: initscript docker, action "start" failed.
● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Thu 2019-03-21 17:46:12 CET; 18ms ago
     Docs: https://docs.docker.com
  Process: 4481 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
 Main PID: 4481 (code=exited, status=1/FAILURE)
      CPU: 179ms

Mär 21 17:46:12 docker.example.com systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Mär 21 17:46:12 docker.example.com systemd[1]: Failed to start Docker Application Container Engine.
Mär 21 17:46:12 docker.example.com systemd[1]: docker.service: Unit entered failed state.
Mär 21 17:46:12 docker.example.com systemd[1]: docker.service: Failed with result 'exit-code'.
dpkg: Fehler beim Bearbeiten des Paketes docker-ce (--configure):
 Unterprozess installiertes post-installation-Skript gab den Fehlerwert 1 zurück
Fehler traten auf beim Bearbeiten von:
 docker-ce
E: Sub-process /usr/bin/dpkg returned an error code (1)

When i run journalctl -xe i get some error lines:

level=error msg="'overlay' not found as a supported filesystem on this host. Please ensure kernel is new enough and has overlay support loaded." storage-driver=overlay2
level=error msg="AUFS was not found in /proc/filesystems" storage-driver=aufs
level=error msg="'overlay' not found as a supported filesystem on this host. Please ensure kernel is new enough and has overlay support loaded." storage-driver=overlay
level=error msg="Failed to built-in GetDriver graph devicemapper /var/lib/docker"

...

Error starting daemon: Error initializing network controller: error obtaining controller instance: failed to create NAT chain DOCKER: iptables failed: iptables -t nat -N DOCKER: modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.19.4-example/modules.dep.bin'
modprobe: FATAL: Module ip_tables not found in directory /lib/modules/4.19.4-example
iptables v1.6.0: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
(exit status 3)
docker.service: Main process exited, code=exited, status=1/FAILURE
Failed to start Docker Application Container Engine.

I have already rebooted multiple times and checked that iptables is there before installing docker.

How can i make it work?

user393856
  • 185
  • 3
  • 15

1 Answers1

0

The company providing the VM is using debian with a more recent kernel. When docker was searching for modules it was locking for the modules for the recent kernel, which have a different version number than the modules shipped with debian. Letting the company install the modules for the used kernel version fixed the problem.

user393856
  • 185
  • 3
  • 15