- slirp4netns/vpnkit is no longer needed as gvisor-tap-vsock is now embedded in RootlessKit.
slirp4netns/vpnkit is still used when installed.
- The `builtin` port driver can now correctly propagate the source IP, when
`userland-proxy` is disabled.
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
| ... | ... |
@@ -8,10 +8,6 @@ ARG GOLANG_IMAGE="golang:${GO_VERSION}-${BASE_DEBIAN_DISTRO}"
|
| 8 | 8 |
# It must be a valid tag in the docker.io/tonistiigi/xx image repository. |
| 9 | 9 |
ARG XX_VERSION=1.9.0 |
| 10 | 10 |
|
| 11 |
-# VPNKIT_VERSION is the version of the vpnkit binary which is used as a fallback |
|
| 12 |
-# network driver for rootless. |
|
| 13 |
-ARG VPNKIT_VERSION=0.6.0 |
|
| 14 |
- |
|
| 15 | 11 |
# DOCKERCLI_VERSION is the version of the CLI to install in the dev-container. |
| 16 | 12 |
ARG DOCKERCLI_VERSION=v29.4.0 |
| 17 | 13 |
ARG DOCKERCLI_REPOSITORY="https://github.com/docker/cli.git" |
| ... | ... |
@@ -328,7 +324,7 @@ FROM tini-${TARGETOS} AS tini
|
| 328 | 328 |
# rootlesskit |
| 329 | 329 |
FROM base AS rootlesskit-src |
| 330 | 330 |
WORKDIR /usr/src/rootlesskit |
| 331 |
-ARG ROOTLESSKIT_VERSION=v2.3.6 |
|
| 331 |
+ARG ROOTLESSKIT_VERSION=v3.0.0 |
|
| 332 | 332 |
ADD https://github.com/rootless-containers/rootlesskit.git?ref=${ROOTLESSKIT_VERSION}&keep-git-dir=1 .
|
| 333 | 333 |
|
| 334 | 334 |
FROM base AS rootlesskit-build |
| ... | ... |
@@ -388,19 +384,6 @@ RUN ./autogen.sh && \ |
| 388 | 388 |
./configure --bindir=/build && \ |
| 389 | 389 |
make -j install |
| 390 | 390 |
|
| 391 |
-# vpnkit |
|
| 392 |
-# use dummy scratch stage to avoid build to fail for unsupported platforms |
|
| 393 |
-FROM scratch AS vpnkit-windows |
|
| 394 |
-FROM scratch AS vpnkit-linux-386 |
|
| 395 |
-FROM scratch AS vpnkit-linux-arm |
|
| 396 |
-FROM scratch AS vpnkit-linux-ppc64le |
|
| 397 |
-FROM scratch AS vpnkit-linux-riscv64 |
|
| 398 |
-FROM scratch AS vpnkit-linux-s390x |
|
| 399 |
-FROM moby/vpnkit-bin:${VPNKIT_VERSION} AS vpnkit-linux-amd64
|
|
| 400 |
-FROM moby/vpnkit-bin:${VPNKIT_VERSION} AS vpnkit-linux-arm64
|
|
| 401 |
-FROM vpnkit-linux-${TARGETARCH} AS vpnkit-linux
|
|
| 402 |
-FROM vpnkit-${TARGETOS} AS vpnkit
|
|
| 403 |
- |
|
| 404 | 391 |
# containerutility |
| 405 | 392 |
FROM base AS containerutil-src |
| 406 | 393 |
WORKDIR /usr/src/containerutil |
| ... | ... |
@@ -449,7 +432,6 @@ COPY --link --from=shfmt /build/ /usr/local/bin/ |
| 449 | 449 |
COPY --link --from=runc /build/ /usr/local/bin/ |
| 450 | 450 |
COPY --link --from=containerd /build/ /usr/local/bin/ |
| 451 | 451 |
COPY --link --from=rootlesskit /build/ /usr/local/bin/ |
| 452 |
-COPY --link --from=vpnkit / /usr/local/bin/ |
|
| 453 | 452 |
COPY --link --from=containerutil /build/ /usr/local/bin/ |
| 454 | 453 |
COPY --link --from=crun /build/ /usr/local/bin/ |
| 455 | 454 |
COPY --link hack/dockerfile/etc/docker/ /etc/docker/ |
| ... | ... |
@@ -628,7 +610,6 @@ COPY --link --from=runc /build/ / |
| 628 | 628 |
COPY --link --from=containerd /build/ / |
| 629 | 629 |
COPY --link --from=rootlesskit /build/ / |
| 630 | 630 |
COPY --link --from=containerutil /build/ / |
| 631 |
-COPY --link --from=vpnkit / / |
|
| 632 | 631 |
COPY --link --from=build /build / |
| 633 | 632 |
|
| 634 | 633 |
# smoke tests |
| ... | ... |
@@ -298,7 +298,6 @@ init() {
|
| 298 | 298 |
# TODO: support printing non-essential but recommended instructions: |
| 299 | 299 |
# - sysctl: "net.ipv4.ping_group_range" |
| 300 | 300 |
# - sysctl: "net.ipv4.ip_unprivileged_port_start" |
| 301 |
- # - external binary: slirp4netns |
|
| 302 | 301 |
# - external binary: fuse-overlayfs |
| 303 | 302 |
} |
| 304 | 303 |
|
| ... | ... |
@@ -6,16 +6,15 @@ |
| 6 | 6 |
# External dependencies: |
| 7 | 7 |
# * newuidmap and newgidmap needs to be installed. |
| 8 | 8 |
# * /etc/subuid and /etc/subgid needs to be configured for the current user. |
| 9 |
-# * Either one of slirp4netns (>= v0.4.0), VPNKit, lxc-user-nic needs to be installed. |
|
| 10 | 9 |
# |
| 11 | 10 |
# Recognized environment variables: |
| 12 | 11 |
# * DOCKERD_ROOTLESS_ROOTLESSKIT_STATE_DIR=DIR: the rootlesskit state dir. |
| 13 | 12 |
# * Defaults to "$XDG_RUNTIME_DIR/dockerd-rootless". |
| 14 |
-# * DOCKERD_ROOTLESS_ROOTLESSKIT_NET=(slirp4netns|vpnkit|pasta|lxc-user-nic): the rootlesskit network driver. |
|
| 15 |
-# * Defaults to "slirp4netns" if slirp4netns (>= v0.4.0) is installed, else "pasta", else "vpnkit". |
|
| 13 |
+# * DOCKERD_ROOTLESS_ROOTLESSKIT_NET=(slirp4netns|vpnkit|pasta|gvisor-tap-vsock|lxc-user-nic): the rootlesskit network driver. |
|
| 14 |
+# * Defaults to "slirp4netns" if slirp4netns (>= v0.4.0) is installed, else "pasta", else "vpnkit", else "gvisor-tap-vsock". |
|
| 16 | 15 |
# * DOCKERD_ROOTLESS_ROOTLESSKIT_MTU=NUM: the MTU value for the rootlesskit network driver. |
| 17 |
-# * Defaults to 65520 for slirp4netns and pasta, 1500 for other rootlesskit network drivers. |
|
| 18 |
-# * DOCKERD_ROOTLESS_ROOTLESSKIT_PORT_DRIVER=(builtin|slirp4netns|implicit): the rootlesskit port driver. |
|
| 16 |
+# * Defaults to 65520 for slirp4netns, pasta, and gvisor-tap-vsock. Defaults to 1500 for other rootlesskit network drivers. |
|
| 17 |
+# * DOCKERD_ROOTLESS_ROOTLESSKIT_PORT_DRIVER=(builtin|slirp4netns|implicit|gvisor-tap-vsock): the rootlesskit port driver. |
|
| 19 | 18 |
# * Defaults to "implicit" for "pasta", "builtin" for other rootlesskit network drivers. |
| 20 | 19 |
# * DOCKERD_ROOTLESS_ROOTLESSKIT_SLIRP4NETNS_SANDBOX=(auto|true|false): whether to protect slirp4netns with a dedicated mount namespace. |
| 21 | 20 |
# * Defaults to "auto". |
| ... | ... |
@@ -34,14 +33,18 @@ |
| 34 | 34 |
|
| 35 | 35 |
# Guide to choose the network driver and the port driver: |
| 36 | 36 |
# |
| 37 |
-# Network driver | Port driver | Net throughput | Port throughput | Src IP | No SUID | Note |
|
| 38 |
-# ---------------|----------------|----------------|-----------------|--------|---------|--------------------------------------------------------- |
|
| 39 |
-# slirp4netns | builtin | Slow | Fast ✅ | ❌ | ✅ | Default in typical setup |
|
| 40 |
-# vpnkit | builtin | Slow | Fast ✅ | ❌ | ✅ | Default when slirp4netns is not installed |
|
| 41 |
-# slirp4netns | slirp4netns | Slow | Slow | ✅ | ✅ | |
|
| 42 |
-# pasta | implicit | Slow | Fast ✅ | ✅ | ✅ | Experimental; Needs recent version of pasta (2023_12_04) |
|
| 43 |
-# lxc-user-nic | builtin | Fast ✅ | Fast ✅ | ❌ | ❌ | Experimental |
|
| 44 |
-# (bypass4netns) | (bypass4netns) | Fast ✅ | Fast ✅ | ✅ | ✅ | (Not integrated to RootlessKit) |
|
| 37 |
+# Network driver | Port driver | Net throughput | Port throughput | Src IP | No SUID | Note |
|
| 38 |
+# -----------------|------------------|----------------|-----------------|--------|---------|--------------------------------------------------------- |
|
| 39 |
+# gvisor-tap-vsock | builtin | Slow | Fast ✅ | ✅ (*) | ✅ | Default when slirp4netns is not installed |
|
| 40 |
+# slirp4netns | builtin | Slow | Fast ✅ | ✅ (*) | ✅ | Default when slirp4netns is installed |
|
| 41 |
+# vpnkit | builtin | Slow | Fast ✅ | ✅ (*) | ✅ | Legacy |
|
| 42 |
+# gvisor-tap-vsock | gvisor-tap-vsock | Slow | Slow | ❌ | ✅ | Not recommended. Use `builtin` port driver instead. |
|
| 43 |
+# slirp4netns | slirp4netns | Slow | Slow | ✅ | ✅ | |
|
| 44 |
+# pasta | implicit | Slow | Fast ✅ | ✅ | ✅ | Experimental; Needs recent version of pasta (2023_12_04) |
|
| 45 |
+# lxc-user-nic | builtin | Fast ✅ | Fast ✅ | ✅ (*) | ❌ | Experimental |
|
| 46 |
+# (bypass4netns) | (bypass4netns) | Fast ✅ | Fast ✅ | ✅ | ✅ | (Not integrated to RootlessKit) |
|
| 47 |
+# |
|
| 48 |
+# (*) Applicable since RootlessKit v3.0. Also requires userland-proxy to be disabled. |
|
| 45 | 49 |
|
| 46 | 50 |
# See the documentation for the further information: https://docs.docker.com/go/rootless/ |
| 47 | 51 |
|
| ... | ... |
@@ -134,8 +137,7 @@ if [ -z "$net" ]; then |
| 134 | 134 |
fi |
| 135 | 135 |
fi |
| 136 | 136 |
if [ -z "$net" ]; then |
| 137 |
- echo "One of slirp4netns (>= v0.4.0), pasta (passt >= 2023_12_04), or vpnkit needs to be installed" |
|
| 138 |
- exit 1 |
|
| 137 |
+ net=gvisor-tap-vsock |
|
| 139 | 138 |
fi |
| 140 | 139 |
fi |
| 141 | 140 |
if [ "$net" = host ]; then |
| ... | ... |
@@ -143,11 +145,14 @@ if [ "$net" = host ]; then |
| 143 | 143 |
exit 1 |
| 144 | 144 |
fi |
| 145 | 145 |
if [ -z "$mtu" ]; then |
| 146 |
- if [ "$net" = slirp4netns -o "$net" = pasta ]; then |
|
| 147 |
- mtu=65520 |
|
| 148 |
- else |
|
| 149 |
- mtu=1500 |
|
| 150 |
- fi |
|
| 146 |
+ case "$net" in |
|
| 147 |
+ slirp4netns | pasta | gvisor-tap-vsock) |
|
| 148 |
+ mtu=65520 |
|
| 149 |
+ ;; |
|
| 150 |
+ *) |
|
| 151 |
+ mtu=1500 |
|
| 152 |
+ ;; |
|
| 153 |
+ esac |
|
| 151 | 154 |
fi |
| 152 | 155 |
if [ -z "$port_driver" ]; then |
| 153 | 156 |
if [ "$net" = pasta ]; then |
| ... | ... |
@@ -30,7 +30,7 @@ docker buildx bake binary-cross |
| 30 | 30 |
# build binaries for a specific platform |
| 31 | 31 |
docker buildx bake --set *.platform=linux/arm64 |
| 32 | 32 |
|
| 33 |
-# build "complete" binaries (including containerd, runc, vpnkit, etc.) |
|
| 33 |
+# build "complete" binaries (including containerd, runc, etc.) |
|
| 34 | 34 |
docker buildx bake all |
| 35 | 35 |
|
| 36 | 36 |
# build "complete" binaries for all supported platforms |
| ... | ... |
@@ -17,11 +17,6 @@ copy_binaries() {
|
| 17 | 17 |
for file in containerd containerd-shim-runc-v2 ctr runc docker-init rootlesskit dockerd-rootless.sh dockerd-rootless-setuptool.sh; do |
| 18 | 18 |
cp -f "$(command -v "$file")" "$dir/" |
| 19 | 19 |
done |
| 20 |
- # vpnkit might not be available for the target platform, see vpnkit stage in |
|
| 21 |
- # the Dockerfile for more information. |
|
| 22 |
- if command -v vpnkit > /dev/null 2>&1; then |
|
| 23 |
- cp -f "$(command -v vpnkit)" "$dir/" |
|
| 24 |
- fi |
|
| 25 | 20 |
} |
| 26 | 21 |
|
| 27 | 22 |
[ -z "$KEEPDEST" ] && rm -rf "$DEST" |
| ... | ... |
@@ -17,7 +17,4 @@ source "${MAKEDIR}/.install"
|
| 17 | 17 |
install_binary "${DEST}/rootlesskit"
|
| 18 | 18 |
install_binary "${DEST}/dockerd-rootless.sh"
|
| 19 | 19 |
install_binary "${DEST}/dockerd-rootless-setuptool.sh"
|
| 20 |
- if [ -f "${DEST}/vpnkit" ]; then
|
|
| 21 |
- install_binary "${DEST}/vpnkit"
|
|
| 22 |
- fi |
|
| 23 | 20 |
) |