Awesome FOSS Logo
Discover awesome open source software
Launched 🚀🧑‍🚀

Default docker settings on arch

Categories

Default Docker settings on ArchLinux

RTFM. Seriously. The Arch Wiki is seriously one of the most informative wikis I’ve ever read, and has excellent guides. If I had read it closer, I would have avoided one problem I’m about to explain below.

Change the default filesystem

While running on a VPS, I ran into problems deleting containers that were once functional when I was using the default devicemapper driver. The fix for this was simple (and also in the arch manual), and basically consisted of changing the default file system driver to overlayfs. For how to make this change, read on.

If you limited your boot partition, move the storage location for Docker images

This was a problem with my local system (not the VPS) – but basically I limited my boot partition when I was first setting up Arch Linux, so recently while running docker commands I was having issues with space. Of course, after realizing my mistake it was obvious – make sure to change the storage location of your docker images if you limited the partition that the default location (/var/lib/docker).

Making these changes stick with systemd

Changing the lcoation though turned out to be a little difficult, but was made very easy with systemd’s unit file system. Basically, I easily overrode the default unit file for docker by adding an override file (/etc/systemd/system/docker.service.d/override.conf) with contents:

[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -g /home/docker-images -H fd:// -s overlay2