Skip to content

Instantly share code, notes, and snippets.

@cybik
Last active June 5, 2023 02:02
Show Gist options
  • Save cybik/ecceae4f4aa0be576ef822b9deacf12f to your computer and use it in GitHub Desktop.
Save cybik/ecceae4f4aa0be576ef822b9deacf12f to your computer and use it in GitHub Desktop.
Dumb openwrt+docker stuff

So you found the docker OpenWRT containers

Starting the container, replace with your target, from these choices:

  • x86-64
  • armvirt-32
  • armvirt-64

and run the following

docker run --rm -it -p 8880:80 -p 8443:443 -p 8822:22 openwrtorg/rootfs:<ARCH>-19.07.3

arm32

docker run --rm -it -p 8880:80 -p 8443:443 -p 8822:22 openwrtorg/rootfs:armvirt-32-19.07.3

arm64

docker run --rm -it -p 8880:80 -p 8443:443 -p 8822:22 openwrtorg/rootfs:armvirt-64-19.07.3

x86-64

docker run --rm -it -p 8880:80 -p 8443:443 -p 8822:22 openwrtorg/rootfs:x86-64-19.07.3

You got the rootfs active. What now?

In the container, this is my packagestrap:

opkg update; opkg list-upgradable > /tmp/listup; sed -e 's/ .*$//' /tmp/listup | xargs opkg upgrade;
opkg install luci-app-ocserv luci-app-ddns luci-app-upnp luci-app-samba4 luci-app-uhttpd apache nano \
             apache-mod-http2 apache-mod-proxy apache-mod-proxy-html apache-mod-ssl apache-mod-webdav \
             apache-mod-session-crypto apache-utils luci-app-acme luci-app-transmission luci-app-lxc \
             luci-app-nlbwmon luci-app-sqm

Now what?

I dunno, you tell me. This is a quick hack to get it set up and play with it. I'm assuming giving it privileged access to your whole system would make the container a bona fide router layer within an active Docker instance, and you might be able to straight up run a router via Docker.

Not gonna lie, this might end up very useful on a few ARM boards I have.

Some jank about homenet/hncp

opkg remove odhcpd-ipv6only; opkg install odhcpd;
opkg install  luci-app-hnet luci-proto-hnet hnet-full-secure

Shout-outs

  • Ubiquiti because they're awesome people
  • OpenWRT because without them I wouldn't be doing this
  • Qualcomm for being complete toilets and getting me to approach gigabit routing in rather creative fashion
  • Docker/podman/buildah for making the container stuff possible
  • https://hub.docker.com/r/openwrtorg/rootfs for making me waste far more time than should be on this dumb quick hack project thing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment