Thursday, April 14, 2022

[SOLVED] attempt to change docker data-root fails - why

Issue

I am trying to set my docker storage dir as other than default, something I've done on other machines:

/etc/docker/daemon.json:

{
    "data-root": "/mnt/x/y/docker_data"
}

where the storage dir looks like

jeremyr@snorble:~$ ls -ltr /mnt/x/y
total 4
drwxrwxrwx 11 jeremyr  5001  122 Mar 19 08:14 docker_data

with the daemon.json file in place, sudo systemctl restart docker hits Job for docker.service failed (without that daemon.json, docker restarts fine and docker run hello-world runs fine) . with the daemon.json in place, journalctl -xn shows

Mar 25 14:20:33 bolt88 systemd[1]: docker.service start request repeated too quickly, refusing to start.
Mar 25 14:20:33 bolt88 systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: Unit docker.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit docker.service has failed.
-- 
-- The result is failed.
Mar 25 14:20:33 bolt88 systemd[1]: Unit docker.service entered failed state.
Mar 25 14:20:34 bolt88 sudo[23961]: jeremyr : TTY=pts/18 ; PWD=/home/jeremyr ; USER=root ; COMMAND=/bin/journalctl -xn
Mar 25 14:20:34 bolt88 sudo[23961]: pam_unix(sudo:session): session opened for user root by jeremyr(uid=0)

while systemctl status docker.service just shows code=exited, status=1/FAILURE

and in dmesg I see this:

1547:[Mon Mar 25 14:21:41 2019] aufs au_opts_verify:1570:dockerd[20714]: dirperm1 breaks the protection by the permission bits on the lower branch
1548-[Mon Mar 25 14:21:41 2019] device veth34d1dfd entered promiscuous mode
1549-[Mon Mar 25 14:21:41 2019] IPv6: ADDRCONF(NETDEV_UP): veth34d1dfd: link is not ready
1550-[Mon Mar 25 14:21:41 2019] IPv6: ADDRCONF(NETDEV_CHANGE): veth34d1dfd: link becomes ready
1551:[Mon Mar 25 14:21:41 2019] docker0: port 1(veth34d1dfd) entered forwarding state
1552:[Mon Mar 25 14:21:41 2019] docker0: port 1(veth34d1dfd) entered forwarding state
1553:[Mon Mar 25 14:21:41 2019] docker0: port 1(veth34d1dfd) entered disabled state
1554-[Mon Mar 25 14:21:41 2019] device veth34d1dfd left promiscuous mode
1555:[Mon Mar 25 14:21:41 2019] docker0: port 1(veth34d1dfd) entered disabled state
1556-[Mon Mar 25 14:21:59 2019] systemd-sysv-generator[20958]: Ignoring creation of an alias umountiscsi.service for itself

Docker version 17.05.0-ce, build 89658be, on a debian 8.8 setup .

Does anyone know why docker isn't allowing use of that dir as data-root?


Solution

Something is off on the docker_data.

  • Solution:

    1. remove the /etc/docker/daemon.json file.
    2. start docker.
    3. copy the /var/lib/docker contents to the path you've put in /etc/docker/daemon.json.
    4. put back the file /etc/docker/daemon.json and restart docker.


Answered By - hilaf
Answer Checked By - Cary Denson (WPSolving Admin)