Have a look at the first link - I did exactly that. The 'OpenWrt inside Docker' came in parallel.
I got Docker Engine running by repackaging the prebuilt binaries distributed by Docker (putting the full source build in the 'too hard basket' due to Go and cross-compiling), some months later someone figured out how to build the whole thing from source - hence the docker-ce package - https://github.com/openwrt/packages/pull/8397.
As it turns out the 'slim docker' I was hoping for already exists: https://www.balena.io/engine/ . I haven't had a chance to revisit any of this, I was also hoping to split out runc/containerd/etc so they could be integrated with procd.
Sorry to bump this 3-month old thread, but I need to build some lightweight docker containers and it would be great to build them on my OpenWRT router.
I am not a tech guy, and I see there is no official docker-ce packages on the 19.07 repository. Could we expect to get it sometime or is it too difficult to implement docker in OpenWRT?
Installing across versions wouldn't be recommended because they are expecting specific system libraries and other things that are built into the OpenWRT version.
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.
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?
TRY with SUCCESS on 21.02.0 (and update of dockerd docker docker-compose luci-dockerman)
MVEBU ARM64 EspressoBin-Ultra...
root@ultra:~# cat /etc/config/dockerd
# The following settings require a restart of docker to take full effect, A reload will only have partial or no effect:
# bip
# blocked_interfaces
# extra_iptables_args
# device
config globals 'globals'
# option alt_config_file '/etc/docker/daemon.json'
option enable '1'
option data_root '/srv/docker/'
# option data_root '/opt/docker/'
option log_level 'warn'
option iptables '1'
list hosts 'unix:///var/run/docker.sock'
# option bip '172.18.0.1/24'
# option fixed_cidr '172.17.0.0/16'
# option fixed_cidr_v6 'fc00:1::/80'
# option ipv6 '1'
# option ip '::ffff:0.0.0.0'
# list dns '172.17.0.1'
# list registry_mirrors 'https://<my-docker-mirror-host>'
list registry_mirrors 'https://hub.docker.com'
option remote_endpoint '0'
# option bridge 'br-container'
# Docker ignores fw3 rules and by default all external source IPs are allowed to connect to the Docker host.
# See https://docs.docker.com/network/iptables/ for more details.
# firewall config changes are only additive i.e firewall will need to be restarted first to clear old changes,
# then docker restarted to load in new changes.
config firewall 'firewall'
option device 'docker0'
list blocked_interfaces 'wan'
# option extra_iptables_args '--match conntrack ! --ctstate RELATED,ESTABLISHED' # allow outbound connections
root@ultra:~# docker-compose -f /root/LMS/docker-compose.yml up --no-start
Building with native build. Learn about native build in Compose here: https://docs.docker.com/go/compose-native-build/
Recreating lms ... done
FIX : I had to create a missing file which link to a non existing /tmp/localtime
touch /etc/localtime
Then... http://ultra:9000 and LMS is UP and Works fine (look to be faster than with LXC)