mirror of
https://github.com/moby/moby.git
synced 2026-01-11 02:31:44 +00:00
hack: Fix TestOverlay* test failure in pkg/archive
The pkg/archive/archive_linux_test.go tests create a test archive content in a temporary directory. This also includes device nodes (using mknod). Running these tests in Docker-in-Docker (dind) with systemd was failing with "operation not permitted" because the rootfs is remounted with `nodev`. This change aligns `hack/dind-systemd` with `hack/dind` by conditionally mounting a `tmpfs` on `/tmp` (with dev enabled), to make the mknod work. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
committed by
Rob Murray
parent
454a7a7358
commit
8d9e3502ab
@@ -52,6 +52,8 @@ if [ -d /sys/kernel/security ] && ! mountpoint -q /sys/kernel/security; then
|
||||
fi
|
||||
|
||||
# Mount /tmp (conditionally)
|
||||
# /tmp must be 'exec,rw', and 'dev' to allow mknod to work for the
|
||||
# pkg/archive/archive_linux_test.go tests.
|
||||
if ! mountpoint -q /tmp; then
|
||||
mount -t tmpfs none /tmp
|
||||
fi
|
||||
|
||||
@@ -19,6 +19,13 @@ if [ ! -t 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Mount /tmp (conditionally)
|
||||
# /tmp must be 'exec,rw', and 'dev' (defaults) to allow mknod to work for the
|
||||
# pkg/archive/archive_linux_test.go tests.
|
||||
if ! mountpoint -q /tmp; then
|
||||
mount -t tmpfs none /tmp
|
||||
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.
|
||||
|
||||
Reference in New Issue
Block a user