User Tools

Site Tools


sysadminery:docker

on debian, docker.io is docker “the debian way” - i.e., dependencies are shareable packages.

do not attempt to move docker directory

Method 1: -g

from you can set the docker directory to another one - but only if that alternate is also on the same filesystem. (begging the question: why even bother?)

  1. stop your shit
    $ sudo systemctl stop docker.socket
    $ sudo systemctl stop docker.service
  2. edit /lib/systemd/system/docker.service - find ExecStart= and put a -g <dir> before the -H, like so:
    ExecStart=/usr/bin/dockerd -g /new/path/docker -H fd://
  3. prepare that directory. make sure it exists, has the permissions you expect (probably want to chown -R :docker on it)
  4. reload, restart
    $ sudo systemctl daemon-reload
    $ sudo systemctl start docker
  5. test
    ps aux | grep -i docker | grep -v grep

    you should see the -g you added. then you can go into the directory and make sure docker put all its shit there.

Method 2: rmount

from you can recursively mount any linux directory in any other - but docker trips over not being allowed to create hard links, and fails.

sysadminery/docker.txt · Last modified: 2023/02/14 06:07 by 127.0.0.1