Docker engine on OpenWrt

Thank you again.

So my best bet is to wait for a 19.07.4 or 20.XX release to have it included in the stable branch, right?

It seems docker-ce was not included in 19.07.4, I cannot find it in the LuCi package search function.

I hope it will be included in 20.XX

Been waiting for this too.
I've got plenty of headroom on my router though. Using an x86_64. Interested if anyone has used the static binaries from Docker.

Hello, found this thread and is anybody else trying to run the new docker-ce on openWRT?!?
I got a aarch64 host with 2GB of RAM and a 64GB SDCard, so I thought I'd give it a whirl.
docker on x86_64 wouldn't even be worth asking about, that's too easy.

what I installed:

root@n3 opkg list-installed | egrep -i "container|docker|cgroup"
cgroup-tools - 0.41-3
cgroupfs-mount - 2020-06-26-05494281-1
containerd - 1.3.7-1
docker-ce - 19.03.13-1
docker-compose - 1.27.4-1
libcgroup - 0.41-3
luci-app-dockerman - v0.5.13
luci-lib-docker - git-20.211.27004-141857a
lxc-cgroup - 4.0.2-4
python3-docker - 4.3.1-1
python3-dockerpty - 0.4.1-3

yessir, I haz /sys/fs/cgroup mounted:

root@n3 df -hTP
Filesystem           Type            Size      Used Available Capacity Mounted on
/dev/root            ext4           58.8G    468.6M     58.3G   1% /
tmpfs                tmpfs         997.7M    964.0K    996.7M   0% /tmp
tmpfs                tmpfs         512.0K         0    512.0K   0% /dev
/dev/mmcblk0p1       ext4           15.7M     12.1M      3.3M  78% /boot
cgroup               tmpfs         997.7M         0    997.7M   0% sys/fs/cgroup
/dev/root            ext4           58.8G    468.6M     58.3G   1% /opt/docker

yessir, I haz a snapshot release,

because that's all you can do with a rockchip armv8/A53/aarch64 cpu, and docker-ce won't show up in a prod release till later -


root@n3 uname -a
Linux n3 5.4.70 #0 SMP PREEMPT Mon Oct 12 18:59:58 2020 aarch64 GNU/Linux

root@n3 egrep -i "pretty|release" /etc/os-release 
PRETTY_NAME="OpenWrt SNAPSHOT"
OPENWRT_RELEASE="OpenWrt SNAPSHOT r14694-e788e9bd87"

what I did:

root@n3 /etc/init.d/dockerd start

meanwhile chatty little bird rsyslog says:

Oct 14 01:00:07 n3 dockerd-init: Adding docker default interface to network uci config (docker)
Oct 14 01:00:07 n3 dockerd-init: Adding docker default bridge device to network uci config (docker0)
Oct 14 01:00:07 n3 dockerd-init: Adding docker default firewall zone to firewall uci config (docker)
Oct 14 01:00:07 n3 dockerd-init: Updating network uci config option "172.18.0.1/24" for docker default bridge (docker0)
Oct 14 01:00:08 n3 dockerd-init: Updating network uci config option "172.18.0.1/24" for docker default bridge (docker0)
Oct 14 01:00:09 n3 dockerd[1898]: time="2020-10-14T01:00:09.081074086Z" level=warning msg="failed to load plugin io.containerd.snapshotter.v1.devmapper" error="devmapper not configured"
Oct 14 01:00:09 n3 modprobe: failed to find a module named aufs
Oct 14 01:00:09 n3 dockerd[1898]: time="2020-10-14T01:00:09.094011984Z" level=warning msg="could not use snapshotter devmapper in metadata plugin" error="devmapper not configured"
Oct 14 01:00:09 n3 dockerd[1898]: time="2020-10-14T01:00:09.577416251Z" level=warning msg="Your kernel does not support swap memory limit"
Oct 14 01:00:09 n3 dockerd[1898]: time="2020-10-14T01:00:09.577614309Z" level=warning msg="Your kernel does not support cgroup blkio weight"
Oct 14 01:00:09 n3 dockerd[1898]: time="2020-10-14T01:00:09.577653978Z" level=warning msg="Your kernel does not support cgroup blkio weight_device"
Oct 14 01:00:10 n3 dockerd[1898]: failed to start daemon: Devices cgroup isn't mounted

also:

opkg list | egrep -i "aufs|devmap"

whattheheck is aufs? devmapper?

we aint got no multipathd and lvm around here. This is a single SDCard rootdisk! Not even SPI/eMMC/flash!

Do I haveta supply arcane cgroups kernel boot args like we do in CentOS-land?

as things slip way from real docker to moby to podman?

There is currently some work happening to get podman to work with uxc, which basically replaces Docker with a much lower footprint.

1 Like

Try configuring docker to use overlay2 instead of aufs, it's the newer and better storage method.

wow, very interesting! just to let you know, the PR you mentioned has been merged now.

I had the same issues with a snapshot pi build.... took a long time to figure out and dont know why.... but the fix for me was

Update cgroup startup - comment out section

vi /etc/init.d/cgroupfs-mount

#        if mountpoint -q /sys/fs/cgroup; then
#                umount /sys/fs/cgroup/
#        fi

update dockerd start order from 25 -> 60

vi /etc/init.d/dockerd

        START=60

Update startup to setup tmpfs

        mount -t tmpfs -o size=32k tmpfs /run

If no longer needed then great but if stuck, try the above....