-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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
Enabling specifying static ip for predefined network on windows #22208
Conversation
NOTLGTM this will add significant confusion around this topic. |
We really want to support specifying ip address for the default nat network on windows. Is there a reason why specifying ip is not supported for predefined networks? |
Ping. Any feedback? |
ping @mavenugo |
It is because a user can change the predefined network subnet at daemon restart (--fixed-cidr, -bip, ... options). Only user-defined networks have an immutable configuration. |
@aboch This is not the case for windows. A network can't have its subnet changed by just changing docker daemon parameters. This is a requirement we are getting from some teams. |
@msabansal is there any other way the |
@mavenugo The only way is to remove the network and add it with a different subnet. |
This should be supported on Linux too. If the user changes the subnet then on daemon start just fail to start the container. That is a perfectly fine caveat. |
It seems we have legitimate argument both sides. I am actually fine with this caveat : #22208 (comment). |
Thinking again about this, I am OK with this change. The (historical) reasons because of which we do not allow specifying the IP address on predefined network on Linux do not apply on Windows, as @msabansal explained:
Therefore I don't agree we should relax the restiction for Linux. At the end this is about running the daemon on two very different OS platforms. The default network driver is very different as well. IMO some restrictions asymmetry is to be expected. |
@@ -19,13 +19,13 @@ import ( | |||
"github.com/docker/docker/pkg/mount" | |||
"github.com/docker/docker/pkg/stringid" | |||
"github.com/docker/docker/runconfig" | |||
"github.com/docker/docker/vendor/src/github.com/opencontainers/specs/specs-go" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a mis-rewrite of the imports via someone's editor plugin with a possibly wrong GOPATH
setup. Line 28 has the correct import of specs-go
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I messed it up and didn't notice it earlier. Fixing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
OK, lets first do it for windows, and have a follow-up discussion on adding it to linux (or not) |
Signed-off-by: msabansal <sabansal@microsoft.com>
looks good to me |
LGTM |
1 similar comment
LGTM |
- What I did
Windows only has ability for a single nat network. We want to allow specifying custom ip for the network. This is not allowed by docker. I have enabled that support for windows
- How I did it
Added a function to enable ip configuration on predefined networks. The function returns true for windows and false on other platforms.
- How to verify it
- A picture of a cute animal (not mandatory but encouraged)
Signed-off-by: msabansal sabansal@microsoft.com