Archive for June, 2018

Recently I updated to Ubuntu 18.04 Bionic Beaver and tried to install latest docker-ce on that laptop – I expected more-less smooth process, but find some interesting blockers during installation process. So let me share my experience – hope that it will save others time. In default Ubuntu repository I find docker v.15 and docker-ce v.17, but it’s obviously not my choice when I can install latest one 18.05-rc1 🙂 But actually even if you install docker from default repository you’ll struggle with same issues – so you may skip installation part and go ‘make it work’ part instead.

Install from default Ubuntu repository

In my case I can easily install docker 1.17 with
sudo apt-get install docker.io
or docker 1.5 with that
sudo apt-get install docker
Actually I highly recommend to use apt-cache show command to figure out which version you’re trying to install before install it
sudo apt-cache show docker.io

Install docker 18.05 rc1 from docker repository

Installation should go through that process – well described on linuxconfig : How to Install Docker On Ubuntu 18.04 Bionic Beaver:
sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt update
sudo apt-cache show docker-ce

Last line is needed just to check that you really get docker-ce 18.05 added from docker repository. Then just install and check it
sudo apt install docker-ce
sudo docker run hello-world

If everything works fine for this moment, then you’re good – enjoy docker and have fun with containers. But in my case and I believe it’s also case for many others who running VPN client on your Ubuntu, there’s errors on starting docker daemon after installation stage. In my case I got errors:
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
Process: 21542 ExecStart=/usr/bin/dockerd -H fd:// (code=exited, status=1/FAILURE)
Main PID: 21542 (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

Actually if you take a look onto systemctl status docker.service
abokov@abokov-ubuntu:/var/lib/docker$ systemctl status docker.service
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2018-06-01 13:29:07 MSK; 2s ago
Process: 31921 ExecStart=/usr/bin/dockerd -H fd:// (code=exited, status=1/FAILURE)
Main PID: 31921 (code=exited, status=1/FAILURE)

Jun 01 13:29:07 abokov-ubuntu systemd[1]: docker.service: Service hold-off time over, scheduling restart.
Jun 01 13:29:07 abokov-ubuntu systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
Jun 01 13:29:07 abokov-ubuntu systemd[1]: Stopped Docker Application Container Engine.
Jun 01 13:29:07 abokov-ubuntu systemd[1]: docker.service: Start request repeated too quickly.
Jun 01 13:29:07 abokov-ubuntu systemd[1]: docker.service: Failed with result ‘exit-code’.

and journalctl -u docker.service says something like this:
Jun 01 12:44:53 abokov-ubuntu dockerd[21542]: time="2018-06-01T12:44:53.884718719+03:00" level=info msg="Loading containers: start."
Jun 01 12:44:54 abokov-ubuntu dockerd[21542]: Error starting daemon: Error initializing network controller: list bridge addresses failed: no available network
Jun 01 12:44:54 abokov-ubuntu systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Jun 01 12:44:54 abokov-ubuntu systemd[1]: docker.service: Failed with result 'exit-code'.
Jun 01 12:44:54 abokov-ubuntu systemd[1]: Failed to start Docker Application Container Engine.
Jun 01 12:44:54 abokov-ubuntu systemd[1]: docker.service: Service hold-off time over, scheduling restart.

Make it work

Root cause of this problem is that I’m running VPN client on my laptop on the same time and Docker daemon is unable to get network access to find suitable network range to use for container’s network. Actually fix can be shutdown VPN client ( not my case) or manually add network interface bridge and assign a network range for this bridge.
ip link add name docker0 type bridge
ip addr add dev docker0 172.17.0.1/16

One thing that you will lost all these configuration after restart, so you need to choice VPN or add this onto startup/run every time manually.