0

I spent an entire day attempting to get Docker installed, but I think there's something with my system preventing it from being installed and configured properly. Here's the specifications of Docker I'm trying to install, my Ubuntu system, and what I've tried...

Specs:

  • Description: Ubuntu 20.04.2 LTS
  • Codename: Focal
  • Docker version 20.10.5, build 55c4c88

What I've tried:
I've followed the documentation for installation that Docker provides (https://docs.docker.com/engine/install/ubuntu/). I've tried every method listed and always get to the point where I believe Docker was installed, but it always fails to start. When running journalctl -xe I find that it gets an error "Failed to start Docker Application Container Engine."

When going through the "Install Using Repository" method listed by Docker, when I run sudo apt-get install docker-ce docker-ce-cli containerd.io I receive the output provided below...

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 Sat 2021-04-10 14:04:01 CDT; 6ms ago
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com
    Process: 30954 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
   Main PID: 30954 (code=exited, status=1/FAILURE)
dpkg: error processing package docker-ce (--configure):
 installed docker-ce package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of docker-ce-rootless-extras:
 docker-ce-rootless-extras depends on docker-ce; however:
  Package docker-ce is not configured yet.

dpkg: error processing package docker-ce-rootless-extras (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Errors were encountered while processing:
 docker-ce
 docker-ce-rootless-extras
E: Sub-process /usr/bin/dpkg returned an error code (1)

I've also tried running sudo dockerd and when I run that command I receive this output...

INFO[2021-04-10T14:07:34.379732477-05:00] Starting up                                  
INFO[2021-04-10T14:07:34.380601807-05:00] detected 127.0.0.53 nameserver, assuming systemd-resolved, so using resolv.conf: /run/systemd/resolve/resolv.conf 
INFO[2021-04-10T14:07:34.381241252-05:00] parsed scheme: "unix"                         module=grpc
INFO[2021-04-10T14:07:34.381264907-05:00] scheme "unix" not registered, fallback to default scheme  module=grpc
INFO[2021-04-10T14:07:34.381300038-05:00] ccResolverWrapper: sending update to cc: {[{unix:///run/containerd/containerd.sock  <nil> 0 <nil>}] <nil> <nil>}  module=grpc
INFO[2021-04-10T14:07:34.381314640-05:00] ClientConn switching balancer to "pick_first"  module=grpc
INFO[2021-04-10T14:07:34.382840191-05:00] parsed scheme: "unix"                         module=grpc
INFO[2021-04-10T14:07:34.382879930-05:00] scheme "unix" not registered, fallback to default scheme  module=grpc
INFO[2021-04-10T14:07:34.382919283-05:00] ccResolverWrapper: sending update to cc: {[{unix:///run/containerd/containerd.sock  <nil> 0 <nil>}] <nil> <nil>}  module=grpc
INFO[2021-04-10T14:07:34.382932330-05:00] ClientConn switching balancer to "pick_first"  module=grpc
INFO[2021-04-10T14:07:34.389949119-05:00] [graphdriver] using prior storage driver: overlay2 
WARN[2021-04-10T14:07:34.393356340-05:00] Your kernel does not support CPU realtime scheduler 
WARN[2021-04-10T14:07:34.393368396-05:00] Your kernel does not support cgroup blkio weight 
WARN[2021-04-10T14:07:34.393372980-05:00] Your kernel does not support cgroup blkio weight_device 
INFO[2021-04-10T14:07:34.393489826-05:00] Loading containers: start.                   
WARN[2021-04-10T14:07:34.394967395-05:00] Running modprobe bridge br_netfilter failed with message: modprobe: WARNING: Module br_netfilter not found in directory /lib/modules/5.8.0-48-generic
, error: exit status 1 
WARN[2021-04-10T14:07:34.398454303-05:00] Running iptables --wait -t nat -L -n failed with message: `modprobe: FATAL: Module ip_tables not found in directory /lib/modules/5.8.0-48-generic
iptables v1.8.4 (legacy): can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.`, error: exit status 3 
INFO[2021-04-10T14:07:34.510702953-05:00] stopping event stream following graceful shutdown  error="<nil>" module=libcontainerd namespace=moby
failed to start daemon: Error initializing network controller: error obtaining controller instance: failed to create NAT chain DOCKER: iptables failed: iptables -t nat -N DOCKER: modprobe: FATAL: Module ip_tables not found in directory /lib/modules/5.8.0-48-generic
iptables v1.8.4 (legacy): 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)

Apologies on the poor formatting... If anyone has tips that would be greatly appreciated! Let me know if there's some log / code that would be helpful for troubleshooting!

0

2 Answers 2

0

This errors relates to not loaded Kernel Modules in this case ip_tables

Recommanded ways to fix those issues are as follow

  1. Plain reboot (It's really astonishing how much that can solve issues)
  2. Do an upgrade (sudo apt-get update && sudo apt-get upgrade)
  3. Force load the kernel module

extracted from answer

sudo modprobe ip_tables
sudo echo 'ip_tables' >> /etc/modules
  1. If you're hosting your server at a provider, check that the provider does not modify the kernel beforehand and/or if you run on VPS, check that you don't run OpenDZ VPSs which are very restrictives
2
  • 1
    Thanks for the reply Nicolas! I found that when I ran sudo modprobe ip_tables I get an error saying modprobe: FATAL: Module ip_tables not found in directory /lib/modules/5.8.0-48-generic I took your advise and attempted to add ip_tables to the /etc/modules file, but it wasn't working. I found if I run sudo apt-get install --reinstall linux-modules-5.8.0-48-generic that it would resolve the issue and Docker would start running properly, but it breaks and goes back to the way it was after a restart and I have to run that command again. Any ideas how to keep it working even after a restart? Apr 11, 2021 at 16:29
  • I found that command above from this forum. I am not hosting with a provider.. it's my own hardware in my basement. Thanks again for you assistance! Apr 11, 2021 at 16:40
0

I was able to resolve the issue by re-installing the OS (Ubuntu-Server).

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .