docker-openwrt icon indicating copy to clipboard operation
docker-openwrt copied to clipboard

Feature Request: Provide a sample docker-compose.yml for easier container management

Open M0E-lnx opened this issue 3 years ago • 2 comments

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

M0E-lnx avatar Apr 06 '21 13:04 M0E-lnx

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.

oofnikj avatar Jun 25 '21 12:06 oofnikj

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.

hllhll avatar Jun 26 '21 11:06 hllhll