summaryrefslogtreecommitdiff
path: root/hack
diff options
context:
space:
mode:
authorCory Snider <csnider@mirantis.com>2022-09-21 19:03:04 -0400
committerCory Snider <csnider@mirantis.com>2022-10-26 12:04:37 -0400
commit1f32e3c95d72a29b3eaacba156ed675dba976cb5 (patch)
tree517e71e3b1e72b8261712812e37fb20681ef0f5a /hack
parent542c735926c9208dc0fe9fc02026a110ca0343f9 (diff)
downloaddocker-1f32e3c95d72a29b3eaacba156ed675dba976cb5.tar.gz
Add integration test for #38995, #43390
Modify the DinD entrypoint scripts to make the issue reproducible inside a DinD container. Co-authored-by: Bjorn Neergaard <bneergaard@mirantis.com> Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com> Signed-off-by: Cory Snider <csnider@mirantis.com>
Diffstat (limited to 'hack')
-rwxr-xr-xhack/dind4
-rwxr-xr-xhack/dind-systemd5
2 files changed, 9 insertions, 0 deletions
diff --git a/hack/dind b/hack/dind
index 087270a7a8..04bf6aaf92 100755
--- a/hack/dind
+++ b/hack/dind
@@ -37,6 +37,10 @@ if [ -f /sys/fs/cgroup/cgroup.controllers ]; then
> /sys/fs/cgroup/cgroup.subtree_control
fi
+# Change mount propagation to shared to make the environment more similar to a
+# modern Linux system, e.g. with SystemD as PID 1.
+mount --make-rshared /
+
if [ $# -gt 0 ]; then
exec "$@"
fi
diff --git a/hack/dind-systemd b/hack/dind-systemd
index 27e07badd3..5ab0d25fc1 100755
--- a/hack/dind-systemd
+++ b/hack/dind-systemd
@@ -13,6 +13,11 @@ if [ ! -t 0 ]; then
exit 1
fi
+# Change mount propagation to shared, which SystemD PID 1 would normally do
+# itself when started by the kernel. SystemD skips that when it detects it is
+# running in a container.
+mount --make-rshared /
+
env > /etc/docker-entrypoint-env
cat > /etc/systemd/system/docker-entrypoint.target << EOF