It is possible to move docker directory to another disk

Hi,

When using docker on SBCs with OS on sdcard I usually move the docker to an external disk. Example: https://linuxconfig.org/how-to-move-docker-s-default-var-lib-docker-to-another-directory-on-ubuntu-debian-linux

How can I achieve the same on openwrt?

Thank you

I don't see why not. Since OpenWrt is not using systemd go to /etc/init.d/dockerd and work your way from there.

Same problem here. Docker is located in
/media/nvme/docker and with some containers it is working flawlessly - maybe because they are small.

So let's check if the config is correct:

root@FriendlyWrt:/tmp/dockerd# cat daemon.json 
{ "data-root": "\/media\/nvme\/docker\/", "log-level": "warn", "iptables": true }

This looks good, this is where it should be.

So let's start HA through

root@FriendlyWrt:/# docker run -d   --name homeassistant   --privileged   --restart=unless-stopped   -p 8123:8123   -e TZ="Europe/Berlin"   -v homeassistant_config:/config   --network=host   ghcr.io/home-assistant/home-assistant:stable

Which fails with

docker: failed to register layer: ApplyLayer exit status 1 stdout:  stderr: open /usr/local/lib/python3.10/site-packages/screenlogicpy/requests/request.py: no space left on device.
See 'docker run --help'.

So if I understand it right, the system is still using /usr/local which is of course on a "small" disk. we see the mem peak here

So I checked

and

but they all don't apply :frowning:

So right now I have an unused 1TB SSD in the machine (NanoPi R5S with 4GB RAM, 32GB onboard eMMC and 1TB SSD) but I cannot tell the Docker to start the container :frowning:

Should I create a swap partition? Any recommendation would be highly appreciated!

Is this OpenWrt or FriendlyWrt? If it is the latter, you'd better ask here.

It is FriendlyWRT - my understanding was, that this is based on OpenWRT. Sorry for that.

It is based, but we don't know which alternations they have done to their images.

Would it be better with original OpenWRT? I am not married to FriendlyWRT, so as long as I can run

  • a routing firewall
  • Docker for Zigbee2MQTT/MQTT/HA I am happy
  • the OS on the eMMC
    I would switch immediately.

I cannot suggest you to switch to OpenWrt, as there is no official image for OpenWrt yet.

There is an unofficial image if you want to try.

1 Like