From gentoo-user Fri Dec 02 15:10:03 2022 From: Nikos Chantziaras Date: Fri, 02 Dec 2022 15:10:03 +0000 To: gentoo-user Subject: [gentoo-user] Re: Docker mounting strangeness. Message-Id: X-MARC-Message: https://marc.info/?l=gentoo-user&m=166999339310067 On 01/12/2022 21:48, Laurence Perkins wrote: > I’m setting up an image to use Docker, which will be deployed on > multiple machines.  Since the containers will be large, I didn’t want > them on the root partition. > > Ok, easy enough, I just put it in fstab to mount a different partition > on /var/lib/docker.  Presto, now I don’t have to worry about a container > using up all the OS’s disk space. I don't know what's wrong in your case, but in order to have docker store its files elsewhere, I created this file: /etc/docker/daemon.json with this in it: { "data-root": "/mnt/Data/cache/docker" } I stopped the docker daemon and did: mkdir /mnt/Data/cache/ mv /var/lib/docker /mnt/Data/cache/ as root. Then started the docker daemon again and it worked. /etc/docker/daemon.json is useful for other settings as well, like enabling BuildKit by default without having to specify it on the command line every time. I use: { "data-root": "/mnt/Data/cache/docker", "features": { "buildkit": true } }