Recently I experienced, systemd based container fails to run in certain version of distros.
For ex: If I run my container with systemd I get below messages.
#docker run –rm -t -i –privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro
systemd 219 running in system mode. (+PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID +ELFUTILS +KMOD +IDN)
Detected virtualization docker.
Detected architecture x86-64.
Running with unpopulated /etc.
….
Set hostname to
The line ‘Running with unpopulated /etc’ looked suspicious to me, after some attempts we were able to conclude that, the things were going wrong in absense of ‘/etc/machine-id’ file which used to be there. If you came across similar to this situation, make an entry in your docker file to create /etc/machine-id as shown below and give a try!
#RUN touch /etc/machine-id
now, build your image and start the container from a new image. Let me know how it goes.