Open LaurensVanAcker opened 4 years ago
Is it possible or not?
I'm interested in creating a custom bridge network as well. I tried it docker-compose style as @LaurensVanAcker did it in the post above, but without any luck.
I guess, rancher-compose doesn't support network configuration, right? How can we configure user defined bridge networks in rancher-compose and automatically attach containers to them? Couldn't find anything in the rancheros docs...
I need the custom bridge network mainly for container communication. I don't want to use the deprecated --link argument.
@prupp , @LaurensVanAcker
I know it's possible way too late, but I've had the same requirement for running caddy and forwarding the requests to to the specific container by name.
I use BurmillaOS, which is a fork of RancherOS, since RancherOS is EOL and does not work on the Pi 4.
I had to look in the source code of rancher-compose, because documentation for this use case is virtually non-existent.
To make it work you have to create a new network
docker network create web
and put all containers, which should communicate between each other in the same network with net:
image:
image: image/image
container_name: image
net: web
It seems that setting this via config is not supported, so you have to issue the docker command one time, or add it to cloud config, which might work also, but I have not tried this:
runcmd:
- [ docker, network, create, web]
Hi
In my custom service, I can specify a network I created from Portainer using net: name123. But how do I create this bridge network from the config files?
I tried adding:
To the config.yml, but it's ignored. I also tried adding this to a custom service yml, but I getting a parse error: