Docker daemon cannot start on Ubuntu 16.04 Linux kernel 4.4

My Docker version is Docker CE 18.06.1.

$ sudo apt list --installed | grep -i docker
docker-ce/xenial,now 18.06.1~ce~3-0~ubuntu amd64 [installed]

Start dockerd.

$ sudo systemctl start docker

I got an error in syslog and cannnot start dockerd.

systemd[1]: Failed to start Docker Application Container Engine.

The cause of this error is that dockerd uses aufs storage engine in systemd startup script. Ubunt 16.04 don’t have aufs module by default. You can install aufs module but if you use Linux kernel 4.0 >=, you can use overlay2. So you can change the storage driver to --storage-driver overlay2 from --storage-driver aufs.

/etc/systemd/system/docker.service.d/10-machine.conf

[Service]
ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2376 -H unix:///var/run/docker.sock --storage-driver overlay2 --tlsverify --tlscacert /etc/docker/ca.pem --tlscert /etc/docker/server.pem --tlskey /etc/docker/server-key.pem --label provider=openstack

Start dockerd.

$ sudo systemctl start docker

Use Mono 2.X on Ubuntu 14.04 LTS

Unfortunately, I had to use the Mono which version is 2.X in my project. It’s very old, released in 2012! So I installed it on Ubuntu 16.04 LTS from source and do make. Then the error occurred in doing make like this:

./.libs/libmini-static.a(libmini_static_la-mini.o): In function `mono_get_jit_tls_offset':
/home/vagrant/mono-2.11.4/mono/mini/mini.c:2506: undefined reference to `mono_jit_tls'
/home/vagrant/mono-2.11.4/mono/mini/mini.c:2506: undefined reference to `mono_jit_tls'
collect2: error: ld returned 1 exit status
Makefile:1351: recipe for target 'mono' failed
make[4]: *** [mono] Error 1
make[4]: Leaving directory '/home/vagrant/mono-2.11.4/mono/mini'
Makefile:1209: recipe for target 'all' failed
make[3]: *** [all] Error 2
make[3]: Leaving directory '/home/vagrant/mono-2.11.4/mono/mini'
Makefile:344: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/vagrant/mono-2.11.4/mono'
Makefile:419: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/vagrant/mono-2.11.4'
Makefile:344: recipe for target 'all' failed
make: *** [all] Error 2

So I ended up using Ubuntu 14.04 LTS for Mono 2.X.

The error might occur by the libraries that are gcc or something related to compilation.

How to change Timezone on Docker with Ubuntu 16.04

Ubuntu 16.04 and every other use UTC by default.

I want to change to JST. So I search about this on the web, and some site said to use like this.

Show list of time zone

$ timedatectl list-timezones

But I executed this command, and then above message occurs.

Error about bus happen

$ timedatectl list-timezones
Failed to create bus connection: No such file or directory

It is a problem to use systemd. Ubuntu has used systemd since 16.04.

To use systemd on docker container is pretty tough. So I used tzdata. It is still available to install via apt on Ubuntu 16.04, but if you can also change time zone with systemd. See this document.

I write this config in Dockerfile like this. And build the container.

Dockerfile

FROM ubuntu:16.04

RUN \
  apt-get -y install tzdata && \
  ln -sf /usr/share/zoneinfo/Asia/Tokyo /etc/localtime

Then I enter the container and check time zone.

root@4dbd2aff2747:~# cat /etc/timezone
Asia/Tokyo

root@9dce4012502e:~# strings /etc/localtime
TZif2
JCST
TZif2
JCST
JST-9

The docker container’s time zone becomes JST!