docker-openwrt
docker-openwrt copied to clipboard
Feature Request: Provide a sample docker-compose.yml for easier container management
I know docker offers some complex networking options and docker-compose offers a lot of functionality that could be useful to manager this by the docker daemon rather the systemd service file offered here. Unfortunately, I do not know docker or docker-compose well enough create such a complex setup. This would also make it easier to keep persistent data (such as configs) across upgrades.
My particular use case would have something like this:
openwrt-wan: DHCP address from the standard docker bridge network (this is provided by docker, so no config necessary here) openwrt-lan: This would be a static IP that does need to be configured by a network block in docker-compose.yml
The docker-compose management approach would create and tear down the networks as necessary
This may be a helpful starting point: https://runnable.com/docker/docker-compose-networking
Hi @M0E-lnx thanks for your suggestion.
I did try at first to implement this project using docker-compose but there are some additional responsibilities handled by the init script (network namespace stuff primarily among them) that cannot be addressed with docker-compose. This would require a wrapper script which only increases the complexity and dependencies of the deployment.
Regarding persistence, there is a doc explaining how to upgrade and preserve config. It's a little bit of a mess because of how OpenWrt handles upgrades in a typical squashfs deployment, but I've performed an upgrade across a couple of versions without issue.
An alternative approach might be to mount /etc/config
as a Docker volume, but that would still require some additional steps to address missing packages, configuration file format changes, etc.
I Also spent some time trying to "composify" the project with no success; I ended up running this first on boot; and executing my compose with other services after this has run.