Skip to content
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

Merged
merged 1 commit into from
Aug 12, 2016
Merged

Enabling specifying static ip for predefined network on windows #22208

merged 1 commit into from
Aug 12, 2016

Conversation

msabansal
Copy link
Contributor

- 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

@cpuguy83
Copy link
Member

NOTLGTM this will add significant confusion around this topic.

@msabansal
Copy link
Contributor Author

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?

@msabansal
Copy link
Contributor Author

Ping. Any feedback?

@cpuguy83
Copy link
Member

cpuguy83 commented May 9, 2016

ping @mavenugo

@aboch
Copy link
Contributor

aboch commented May 9, 2016

@msabansal

Is there a reason why specifying ip is not supported for predefined networks?

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.

@msabansal
Copy link
Contributor Author

@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.

@mavenugo
Copy link
Contributor

@msabansal is there any other way the nat network's subnet can be changed ?

@msabansal
Copy link
Contributor Author

@mavenugo The only way is to remove the network and add it with a different subnet.

@ibuildthecloud
Copy link
Contributor

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.

@thaJeztah thaJeztah added the status/needs-attention Calls for a collective discussion during a review session label Jun 7, 2016
@mavenugo
Copy link
Contributor

It seems we have legitimate argument both sides. I am actually fine with this caveat : #22208 (comment).
@ibuildthecloud @aboch @cpuguy83 @thaJeztah @msabansal WDYT ?

@aboch
Copy link
Contributor

aboch commented Jun 28, 2016

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:

@aboch This is not the case for windows. A network can't have its subnet changed by just changing docker daemon parameters.

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"
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@thaJeztah
Copy link
Member

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>
@thaJeztah thaJeztah removed the status/needs-attention Calls for a collective discussion during a review session label Jul 1, 2016
@LK4D4
Copy link
Contributor

LK4D4 commented Aug 5, 2016

@mavenugo @aboch can review?

@aboch
Copy link
Contributor

aboch commented Aug 6, 2016

looks good to me

@thaJeztah
Copy link
Member

LGTM

1 similar comment
@crosbymichael
Copy link
Contributor

LGTM

@crosbymichael crosbymichael merged commit 5632768 into moby:master Aug 12, 2016
@thaJeztah thaJeztah added this to the 1.13.0 milestone Aug 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants