Open imjustleaving opened 3 months ago
yup same issue here
Hi, I thought this was a bug also, but it's not. You're specifying the network in the compose file with the "External networks" slider. You still need to tell the container to use the network also. This screenshot shows that the slider adds the network to the compose file, but you still need to add it in the container config in the compose file.
You can do that by typing it manually: Or you can do it by editing the container settings in dockge: (At the bottom, whole screenshot added for context).
thanks @clupss - I had this same issue and your explanation helped (I somehow missed that 'edit' button for each container...)
Some of my confusion stems from the docker compose documentation for using pre-existing networks which says that if an external network is defined in the top-level network element , compose will look for it and attach containers to it if it exists (instead of creating a network).
Implied by the language and example are: 1) if no other networks are specified in the network top level element, and 2) if no networks are specified in the service top-level element, then 3) the network defined in the network top level element will be treated as the default network, and containers will be attached to it.
It might be documented somewhere else but it seems that the following rules apply: 1) unless a network is specified in the service element, the container will join a default network, and 2) the default network will always be a container specific bridge network unless the default is explicitly defined in the network top-level element.
Which leads me to the following feature request: 1) a toggle in the network block of the compose editor to designate a network that you've toggled on as the default network (which would adjust the formatting of that network element appropriately), e.g. from:
networks:
networkname:
external: true
to:
networks:
default:
name: networkname
external: true
thanks @clupss - I had this same issue and your explanation helped (I somehow missed that 'edit' button for each container...)
Some of my confusion stems from the docker compose documentation for using pre-existing networks which says that if an external network is defined in the top-level network element , compose will look for it and attach containers to it if it exists (instead of creating a network).
Implied by the language and example are: 1) if no other networks are specified in the network top level element, and 2) if no networks are specified in the service top-level element, then 3) the network defined in the network top level element will be treated as the default network, and containers will be attached to it.
It might be documented somewhere else but it seems that the following rules apply: 1) unless a network is specified in the service element, the container will join a default network, and 2) the default network will always be a container specific bridge network unless the default is explicitly defined in the network top-level element.
Which leads me to the following feature request: 1) a toggle in the network block of the compose editor to designate a network that you've toggled on as the default network (which would adjust the formatting of that network element appropriately), e.g. from:
networks: networkname: external: true
to:
networks: default: name: networkname external: true
This worked for me. Thank you.
⚠️ Please verify that this bug has NOT been reported before.
🛡️ Security Policy
Description
I am trying to replicate the Join Networks feature in Portainer by using the sliders in the External Network section when I deploy or edit a container.
👟 Reproduction steps
👀 Expected behavior
the Containers: {} line should have the info for the containers I selected to join the testnet network, in this case, prowlarr
😓 Actual Behavior
Containers: {} line remained empty.
Dockge Version
1.4.2
💻 Operating System and Arch
Ubuntu 24.04
🌐 Browser
Firerfox 129.0
🐋 Docker Version
Docker 26
🟩 NodeJS Version
No response
📝 Relevant log output
No response