Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.

Commit 08289ce

Browse files
committed
dockerd-rootless.sh: bump up slirp4netns requirement to v0.4.0
slirp4netns v0.3.X turned out not to work with RootlessKit >= v0.7.1: rootless-containers/rootlesskit#143 As slirp4netns v0.3.X reached EOL on Mar 31, 2020, RootlessKit is not going to fix support for slirp4netns v0.3.X. Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp> (cherry picked from commit c86abee1a49b482935ae805c8fb724086b732141) Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp> Upstream-commit: 9057ddf37c19c9d0eb7bc4a99677033b9e24bf17 Component: engine
1 parent ea22cea commit 08289ce

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

components/engine/contrib/dockerd-rootless.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# External dependencies:
88
# * newuidmap and newgidmap needs to be installed.
99
# * /etc/subuid and /etc/subgid needs to be configured for the current user.
10-
# * Either one of slirp4netns (v0.3+), VPNKit, lxc-user-nic needs to be installed.
10+
# * Either one of slirp4netns (>= v0.4.0), VPNKit, lxc-user-nic needs to be installed.
1111
# slirp4netns is used by default if installed. Otherwise fallsback to VPNKit.
1212
# The default value can be overridden with $DOCKERD_ROOTLESS_ROOTLESSKIT_NET=(slirp4netns|vpnkit|lxc-user-nic)
1313
#
@@ -37,27 +37,27 @@ fi
3737

3838
: "${DOCKERD_ROOTLESS_ROOTLESSKIT_NET:=}"
3939
: "${DOCKERD_ROOTLESS_ROOTLESSKIT_MTU:=}"
40-
# if slirp4netns v0.4.0+ is installed, slirp4netns is hardened using sandbox (mount namespace) and seccomp
4140
: "${DOCKERD_ROOTLESS_ROOTLESSKIT_SLIRP4NETNS_SANDBOX:=auto}"
4241
: "${DOCKERD_ROOTLESS_ROOTLESSKIT_SLIRP4NETNS_SECCOMP:=auto}"
4342
net=$DOCKERD_ROOTLESS_ROOTLESSKIT_NET
4443
mtu=$DOCKERD_ROOTLESS_ROOTLESSKIT_MTU
4544
if [ -z $net ]; then
4645
if which slirp4netns >/dev/null 2>&1; then
47-
if slirp4netns --help | grep -- --disable-host-loopback; then
46+
# If --netns-type is present in --help, slirp4netns is >= v0.4.0.
47+
if slirp4netns --help | grep -qw -- --netns-type; then
4848
net=slirp4netns
4949
if [ -z $mtu ]; then
5050
mtu=65520
5151
fi
5252
else
53-
echo "slirp4netns does not support --disable-host-loopback. Falling back to VPNKit."
53+
echo "slirp4netns found but seems older than v0.4.0. Falling back to VPNKit."
5454
fi
5555
fi
5656
if [ -z $net ]; then
5757
if which vpnkit >/dev/null 2>&1; then
5858
net=vpnkit
5959
else
60-
echo "Either slirp4netns (v0.3+) or vpnkit needs to be installed"
60+
echo "Either slirp4netns (>= v0.4.0) or vpnkit needs to be installed"
6161
exit 1
6262
fi
6363
fi

0 commit comments

Comments
 (0)