[RFC] OpenWrt within a Docker container

Baptiste Jonglez baptiste at bitsofnetworks.org
Mon May 17 14:42:55 PDT 2021


Hi,

On 17-05-21, Paul Spooren wrote:
> Hello,
> 
> after some back and forth I'd like to request some more opinions on what
> kind of Docker containers to offer containing the OpenWrt rootfs. This is
> not about the SDK or ImageBuilder Docker containers.
> 
> tl;dr:
> 
> Should we ship `slim` containers only, running a OpenWrt shell (ash) and
> nothing more? Whoever wants services to run (e.g. ubus) should run
> additional containers and glue them together via mounts? Or should we run
> /sbin/init or `procd` to have a *OpenWrt-like experience*, with LuCI, ubusd
> and friends.

It's a matter of use-cases: what do people want to do with OpenWrt in
docker?  I see two main use-cases:

1) dev / testing

2) running as an actual "virtualized" router


I use docker from time to time to quickly test the userspace (musl,
busybox, uclient, etc), so it's basically the first use-case and I just
need a shell for this.  This is the way most "basic" Docker containers
work.

That being said, my students used Docker for LuCI dev, and I think it
relied on the fact that services (procd, ubusd, uhttpd) were already
running in the container:

https://gricad-gitlab.univ-grenoble-alpes.fr/projet-ter-m1-wic-openwrt/luci/-/blob/docker/docker-compose.yml
https://gricad-gitlab.univ-grenoble-alpes.fr/projet-ter-m1-wic-openwrt/luci/-/blob/docker/docker/Dockerfile

Maybe we should provide the "official" image with just a shell, and then
another image with running services?


The second use-case (running as an actual router) does not really fit the
way docker works, especially with networking.  For this use-case I think
it's much better to run OpenWrt in LXC or as a VM, and some people
actually do that.  But if people really want to use docker for this, they
can do it with their own Dockerfile or docker-compose setup.

Baptiste
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.openwrt.org/pipermail/openwrt-devel/attachments/20210517/92d0483c/attachment.sig>


More information about the openwrt-devel mailing list