-
Notifications
You must be signed in to change notification settings - Fork 99
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
Port API: support specifying IP version explicitly ("tcp4", "tcp6") #232
Conversation
Signed-off-by: Akihiro Suda <[email protected]>
d64a282
to
17f4357
Compare
Fix rootless-containers#231 Signed-off-by: Akihiro Suda <[email protected]>
The `-proto` argument of `docker-proxy` is like "tcp", but we need to convert it to "tcp4" or "tcp6" explicitly when calling RootlessKit API, for libnetwork >= 20201216. If the port driver does not support "tcp6" (especially when the port driver is slirp4netns), `rootlesskit-docker-proxy` skips exposing the port via RootlessKit API, without showing an error. (We can't raise an error here, because `docker run -p 8080:80` always causes `rootlesskit-docker-proxy -host-ip ::` as well as `r-d-p -h-i 0.0.0.0`) See https://github.com/moby/libnetwork/pull/2604/files#diff-8fa48beed55dd033bf8e4f8c40b31cf69d0b2cc5d4bb53cde8594670ea6c938aR20 See also rootless-containers#231 Using this version of `rootlesskit-docker-proxy` with libnetwork < 20201216 is also fine, because Rootless Docker had never officially supported IPv6. Signed-off-by: Akihiro Suda <[email protected]>
GET /info
GET /info
+ support specifying IP version explicitly ("tcp4", "tcp6") + ...
GET /info
+ support specifying IP version explicitly ("tcp4", "tcp6") + ...Signed-off-by: Akihiro Suda <[email protected]>
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.
LGTM
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.
SGTM; should we open a 'WIP' pull request against moby "master" to verify (and then in combination with the libnetwork bump?)
@@ -27,6 +27,9 @@ jobs: | |||
run: docker run --rm --privileged rootlesskit:test-integration sh -exc "sudo mount --make-rshared / && ./integration-propagation.sh" | |||
- name: "Integration test: restart" | |||
run: docker run --rm --privileged rootlesskit:test-integration ./integration-restart.sh | |||
- name: "Integration test: port" | |||
# NOTE: "--net=host" is a bad hack to enable IPv6 |
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.
❤️
Opened moby/moby#42102 |
Commit 1: API: support
GET /info
e.g.
Inspecting
.portDriver.protos
is required for implementing #231 (comment)Commit 2: Port API: support specifying IP version explicitly ("tcp4", "tcp6")
Fix #231
See
./docs.port.md
Commit 3: rootlesskit-docker-proxy: support libnetwork >= 20201216 convention
The
-proto
argument ofdocker-proxy
is like "tcp", but we need to convert it to "tcp4" or "tcp6" explicitly when calling RootlessKit API, for libnetwork >= 20201216.If the port driver does not support "tcp6" (especially when the port driver is slirp4netns),
rootlesskit-docker-proxy
skips exposing the port via RootlessKit API, without showing an error.(We can't raise an error here, because
docker run -p 8080:80
always causesrootlesskit-docker-proxy -host-ip ::
as well asr-d-p -h-i 0.0.0.0
)See https://github.com/moby/libnetwork/pull/2604/files#diff-8fa48beed55dd033bf8e4f8c40b31cf69d0b2cc5d4bb53cde8594670ea6c938aR20
See also #231
Using this version of
rootlesskit-docker-proxy
with libnetwork < 20201216 is also fine, because Rootless Docker had never officially supported IPv6.