Port API: support specifying IP version explicitly ("tcp4", "tcp6")#232
Merged
Conversation
Signed-off-by: Akihiro Suda <[email protected]>
AkihiroSuda
marked this pull request as draft
March 1, 2021 15:04
AkihiroSuda
force-pushed
the
dev
branch
2 times, most recently
from
March 1, 2021 15:33
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]>
AkihiroSuda
marked this pull request as ready for review
March 1, 2021 16:39
5 tasks
AkihiroSuda
marked this pull request as draft
March 1, 2021 16:45
GET /infoGET /info + support specifying IP version explicitly ("tcp4", "tcp6") + ...
GET /info + support specifying IP version explicitly ("tcp4", "tcp6") + ...
AkihiroSuda
marked this pull request as ready for review
March 1, 2021 17:06
Signed-off-by: Akihiro Suda <[email protected]>
thaJeztah
reviewed
Mar 1, 2021
thaJeztah
left a comment
Contributor
There was a problem hiding this comment.
SGTM; should we open a 'WIP' pull request against moby "master" to verify (and then in combination with the libnetwork bump?)
| - 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 |
Member
Author
Opened moby/moby#42102 |
Merged
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Commit 1: API: support
GET /infoe.g.
Inspecting
.portDriver.protosis required for implementing #231 (comment)Commit 2: Port API: support specifying IP version explicitly ("tcp4", "tcp6")
Fix #231
See
./docs.port.mdCommit 3: rootlesskit-docker-proxy: support libnetwork >= 20201216 convention
The
-protoargument ofdocker-proxyis 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-proxyskips exposing the port via RootlessKit API, without showing an error.(We can't raise an error here, because
docker run -p 8080:80always 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-proxywith libnetwork < 20201216 is also fine, because Rootless Docker had never officially supported IPv6.