From b32cfc3b3a9d791ed3924ab168f27962dceec949 Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Wed, 6 Mar 2024 07:43:00 +0900 Subject: [PATCH] dockerd-rootless-setuptool.sh: check RootlessKit functionality RootlessKit will print hints if something is still unsatisfied. e.g., `kernel.apparmor_restrict_unprivileged_userns` constraint rootless-containers/rootlesskit@33c3e7ca6c3f76e74e8acd5b53668dcd3d8e58e0 Signed-off-by: Akihiro Suda --- contrib/dockerd-rootless-setuptool.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/contrib/dockerd-rootless-setuptool.sh b/contrib/dockerd-rootless-setuptool.sh index ed9b664ba9..4a9ae75bae 100755 --- a/contrib/dockerd-rootless-setuptool.sh +++ b/contrib/dockerd-rootless-setuptool.sh @@ -269,6 +269,13 @@ init() { # - sysctl: "net.ipv4.ip_unprivileged_port_start" # - external binary: slirp4netns # - external binary: fuse-overlayfs + + # check RootlessKit functionality. RootlessKit will print hints if something is still unsatisfied. + # (e.g., `kernel.apparmor_restrict_unprivileged_userns` constraint) + if ! rootlesskit true; then + ERROR "RootlessKit failed, see the error messages and https://rootlesscontaine.rs/getting-started/common/ ." + exit 1 + fi } # CLI subcommand: "check"