Has anyone gotten overlayroot and docker to work together? I'm running Ubuntu 18.04.3LTS and docker daemon won't start up.


sudo apt-get install docker.io overlayroot

sudo docker ps #works, no errors.

Edit /etc/overlayroot.conf to change: overlayroot="" to overlayroot="tmpfs"

sudo update-initramfs -u

sudo reboot #to reboot into the read only overlay filesystem

sudo docker ps # Get the following error:

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

ps: to remove the overlay filesystem do the following:

sudo overlayroot-chroot

Edit that same file to put it back to the original.

sudo update-initramfs -u

exit #to exit the chroot environment

sudo reboot #your system is back to a normal read/write Ubuntu system and "sudo docker ps" works again.


Solved my own problem.

Docker uses an overlay2 file system in /var/lib/docker. An overlay2 filesystem cannot be used on an overlay file system that overlayroot uses. It can however reside on it as regular files. So my solution was to: make a copy of /var/lib/docker/overlay2. Mount a tmpfs on /var/lib/docker/overlay2 On boot - copy that copy of /var/lib/docker/overlay2 to that tmpfs. Start up docker. Docker now sees it on an tmpfs, not an overlay file system.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.