Having fought with this on openwrt:
What i did:
Dockers default bridge should only be used for testing purposes and really you should create your own named bridge interface - the reason it defaults to creating a new docker interface.
Official docker docs do say that!
You can do this by cli or gui, but doing via cli is easier as you need to set some options for it to work correctly on openwrt i.e
"com.docker.network.bridge.enable_icc": "true",
"com.docker.network.bridge.enable_ip_masquerade": "true",
"com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
"com.docker.network.bridge.name": "docker1",
"com.docker.network.driver.mtu": "1500"
So what i did was create a new bridge interface called 'docker1' and a new interface called 'dockerlan' in the cgi-bin/luci/admin/network/network - 'devices' for the bridge and 'interfaces' for the dockerlan interface
example of /etc/config/network:
config device
option type 'bridge'
option name 'docker1'
config interface 'dockerlan'
option proto 'none'
option device 'docker1'
option auto '0'
With the docker network create command from the ssh shell of openwrt:
docker network create -o com.docker.network.bridge.enable_icc=true -o com.docker.network.bridge.enable_ip_masquerade=true dockerlan -o com.docker.network.bridge.host_binding_ipv4=0.0.0.0 -o com.docker.network.bridge.name=docker1 --ip-range=172.19.0.0/27 --subnet 172.19.0.0/27 --gateway=172.19.0.1
Then for the firewall rule to allow communication to outside etc - /etc/config/firewall
config zone 'docker'
option input 'ACCEPT'
option output 'ACCEPT'
option name 'docker'
option forward 'REJECT'
option log '1'
list network 'dockerlan'
list network 'docker'
list device 'docker0'
list device 'docker1'
config rule
option name 'DockertoDockerAny'
option src 'docker'
option dest 'docker'
option target 'ACCEPT'
Then in my docker-compose files just at the end added
networks:
default:
name: dockerlan
I found using the web of luci for docker networks doesnt add the required options correctly and so wont work properly - has options, but be nice if you can select common options to select.
Be aware that if you did a docker-compose down, it will remove the docker network you created, so just do docker stop and docker rm when trying to update containers etc.
Hope this helps?