-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Composefile v2 & default bridge network ERROR: b'Network-scoped alias is supported only for containers in user defined networks' #3012
Comments
To use the bridge network use Compose relies on network scoped aliases, so if you try to use |
Thanks! Works like a charm! |
@dnephin Is it possible to join both the
|
Would also like to know if a container can join a default bridge network as a external network and a custom network at the same time. Please help! |
I figured out, i can have the docker-compose to start the container in a custom network and then do a docker network connect bridge [container] to join the default network that way. |
I'm also trying to find a way to connect a service to the default bridge network and it's own. @niko ninchan8328 How did you end up doing this? Is there a way to easily do both? |
regarding this message |
@prologic the way i do is to have the docker-compose spin up the container in its network, then use the docker network connect command to assign the container to different network as needed. I don't think you can do the default bridge and dedicated network at the same time in the compose file but I could be wrong |
@ninchan8328 Ahh I see. This sounds like a very good use case for a new autodock plugin say I'll implement this tonight; because it'll mean that I don't have to use |
Without setting a network_mode of bridge docker-compose starting with version 2 of the api will start creating a network automatically based on a scheme of [projectname]_default. This network appears to take an incrementing IP address range (so the first one is 172.18.* after the 172.17.* taken by the bridge network). The network routing devtools sets up doesn't work for ranges outside of 172.17.* so while containers can talk to each other they can't be chatted with from the outside. See also: docker/compose#3012 https://docs.docker.com/compose/compose-file/#network-mode https://docs.docker.com/compose/networking/
My current workaround for joining the bridge network and the default compose created one:
Which gives me:
|
For future reference, the docs for The configuration provided by the bug reporter: version: '2'
services:
debian:
image: debian:wheezy
networks:
default:
external:
name: bridge Should be: version: '2'
services:
debian:
image: debian:wheezy
network_mode: bridge |
@Wilfred This doesn't work for
|
I have an issue where I can network two images together via I've asked about it here: https://groups.google.com/forum/#!topic/drools-setup/VvYVh1GWFps what I need, is for 2 compose services to use the same network as the default network used by regular Edit: using the above |
How to choose Static with network_mode: bridge |
it works for me |
Does anyone have a work-around for: |
how to set static ip address with |
I want to set one of my service to use both the default and external bridge (make it work for nginx-proxy auto self discovery) network, I tried a lot of methods like the following, but it always gave me
|
Since I had the same problem and fix seemed to happen since then: @sueastside your workaround is genius and the only working solution I found after 4h of search. I have a database that runs on the host machine and I need to connect to it. THANK YOU SO MUCH!!! The only thing, that need to be changed to run now is the command of the connection bridge (add |
Note that you can just use the connect-bridge:
image: docker:stable
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
command: /bin/sh -c "docker ps -f label=networks=bridge -q | xargs -I'{}' docker network connect bridge {}" Also, it can easily fail if brought up a second time and errors with endpoint with name already exists in network bridge, but hopefully that's not a big deal. |
@dnephin your short explanation of the cause of the issue doesn't make sense. Why can it set those aliases for networks created with Ok. This is the point when I decided for myself that docker-compose is just a toy and is not suitable for any decent setup. I have to implement everything through nasty custom scripts and direct calls to |
When using composefile version 2 with the default bridge network this error occurs:
This is my docker-compose.yml:
I'm using compose 1.6.0 and docker 1.10.1.
The text was updated successfully, but these errors were encountered: