-
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
Networking doesn't work with Windows containers due to disconnecting containers from networks #3252
Comments
Yes this will block Windows containers from working with Compose V2 as we don't support Hot Add/Remove of Network interfaces (at least for V1). |
ping @mavenugo It'd be nice to be able to update the configuration for a container's connection to a particular network. Perhaps the |
@aanand we dont support any network update operations today. And any such discussion should happen in libnetwork project (maybe : moby/libnetwork#996) so that other maintainers can weigh in. |
I don't see any way to get this fixed for 1.7. The windows engine should support these API calls. If the networking fix makes it into Docker 1.11, we can require API version 1.23 in Compose 1.8 using the v2 format. |
We came up with another plan (thanks @mavenugo for the suggestion). Instead of requiring the new API version we can check for the existence of the alias before disconnecting from the network. If the alias already exists, skip the disconnect/connect. This will require that we set all networking config (aliases and ip addresses) during container create (we don't do that now because we re-connect later with them set). It will also mean that in the case of newer engines that set the default alias, we'll be setting the alias again for non-default networks. |
@bfirsh i have tried latest dev build of docker compose and docker engines, but compose still fails for windows components with message "Windows does not support disconnecting a running container from a network". Is there any build that i can use where this works ? |
@git-jiby-me That's not good. What's your exact sequence of commands, and how complex is your version: "2"
services:
test:
image: busybox
command: top Assuming the command that's failing is |
@aanand its not complex at all, here is the one i used to test
I cannot use the sample you provided since busybox doesn't have a variant for windows, and i set network default as nat because else windows HNS complains. Here are the sequence of commands i did and response
|
@git-jiby-me Windows 10 has bash, and Docker on Windows has busybox :-) Look at https://raw.githubusercontent.com/jhowardmsft/busybox/master/Dockerfile which is used for the integration tests of Windows Docker engine. |
@StefanScherer yes i know, however the official busybox image used in
points to https://github.com/docker-library/busybox/blob/de53df881f8a7cad77fe9e2042ee0a8d38402ce3/uclibc/Dockerfile and shouldn't work in windows 10 as well i believe. I didn't play with windows 10 and linux subsystem for windows yet, still playing with windows server 2016, but some day :) |
Weird - from the |
@aanand the image used in compose is |
Sorry, I should have re-opened this issue earlier. We discovered, after implementing the proposed fix, that the windows engine does not use the same network drivers. The drivers it uses don't support the same things (or something like that), so our fix did not work. This is still "a bug in windows engine" and we don't have a workaround until either disconnect is supported, or it uses a network driver that supports these aliases. That's my understanding of the current situation, but others on this issue have a better understanding of it. |
@dnephin Thanks for the update, i believe MS is strong about not supporting disconnecting container from network any time soon, so i think alias support in network drivers used in windows, is the only way this gets fixed. |
@taylorb-microsoft any idea if we will see alias support in the network drivers in windows, this is one of the big blocker for using windows nodes in a swarm cluster that runs services defined by compose (the other one being missing overlay network support). |
@dnephin Can you please elaborate on the workaround. Is it the following code in connect_container_to_networks:
When I try docker-compose I still see disconnect_container_from_network and connect_container_to_network on Linux with following docker compose: sabansal@sabansal-u1:~/work/src/github.com/msabansal/docker/test$ docker-compose version The reason I am asking is that I am adding some support for aliases on windows and even after that docker-compose is not working for me |
Yes, that's the code. The workaround is that the Docker Engine (as of 1.11 or 1.12, I forget the version) should be adding the container short id as an alias. If Compose finds that short id alias it will skip the disconnect. I'm not sure if we have a test for this, because the Compose code was written before engine supported it. I believe I tested it manually once or twice and it was working with a master version of engine at some point. |
The short id is added on start and not on create. This causes the disconnect to happen when composing. |
Can you please confirm or am I missing something. |
I'm not sure the Engine connects the network, that is certainly possible. |
@dnephin Seems like an engine issue. Networking is allocated in containerStart rather than containerCreate causing this issue. If I move if err := daemon.initializeNetworking(container); err != nil { from containerStart to containerCreate I see things working as expected on my test system Will follow up on docker engine once I have my service discovery changes in |
I still see the issue docker-compose version 1.8.0, build d988a55 compose.cli.verbose_proxy.proxy_callable: docker inspect_network <- ('my') ERROR: for messaging Windows does not support disconnecting a running container from a network |
I have two pending PRs to fix this moby/moby#25987 and moby/moby#26287 |
@msabansal now that those are merged - what's next? |
@msabansal @bfirsh this is awesome, since the issue have milestone set for 1.9.0 i believe with 1.9.0 compose should be working with windows as well. @msabansal i believe for this an update for windows server 2016 is also required right (or no ?), if so when would that be rolling out. |
I validated with the latest master and everything works smoothly. @git-jiby-me Yes an update is needed. This will be windows server 2016 with the GA package. |
awesome !!, looking forward to that, thanks for the work on these @msabansal and everyone else involved :) |
@msabansal when would be windows server 2016 with the GA package be available, or is it out already. |
@msabansal 's changes ( #3252 (comment) ) seem to have been added to the 1.13 milestone. I'll take this out of the current milestone since it seems no code change needs to happen on our end. |
Any update on this? |
tagging Windows networking PM's @JMesser81 and @kallie-b |
@abergs This was fixed in Docker and you should be able to use compose with Windows |
See @taylorb-microsoft's comment here: 313c584#commitcomment-16546187
Windows doesn't support disconnecting containers from networks and isn't going to any time soon. It seems like we should get better APIs for updating aliases on containers instead of doing this which feels like hack.
This is blocking Compose working with Windows containers, I believe.
The text was updated successfully, but these errors were encountered: