aboutsummaryrefslogtreecommitdiff
path: root/tests/docker
diff options
context:
space:
mode:
authorAkihiko Odaki <akihiko.odaki@daynix.com>2024-07-05 09:40:12 +0100
committerAlex Bennée <alex.bennee@linaro.org>2024-07-05 12:33:41 +0100
commitaa8246d8b4f81d5a552837c825fa4c72c55e1de9 (patch)
treeed5a81503cdc6f197de44956a909b007303d8056 /tests/docker
parentf5fcc648083e71cfb9394894903f8ea108ff8831 (diff)
downloadqemu-aa8246d8b4f81d5a552837c825fa4c72c55e1de9.zip
qemu-aa8246d8b4f81d5a552837c825fa4c72c55e1de9.tar.gz
qemu-aa8246d8b4f81d5a552837c825fa4c72c55e1de9.tar.bz2
tests/docker: Specify --userns keep-id for Podman
Previously we are always specifying -u $(UID) to match the UID in the container with one outside. This causes a problem with rootless Podman. Rootless Podman remaps user IDs in the container to ones controllable for the current user outside. The -u option instructs Podman to use a specified UID in the container but does not affect the UID remapping. Therefore, the UID in the container can be remapped to some other UID outside the container. This can make the access to bind-mounted volumes fail because the remapped UID mismatches with the owner of the directories. Replace -u $(UID) with --userns keep-id, which fixes the UID remapping. This change is limited to Podman because Docker does not support --userns keep-id. Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Message-Id: <20240626-podman-v1-1-f8c8daf2bb0a@daynix.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20240705084047.857176-6-alex.bennee@linaro.org>
Diffstat (limited to 'tests/docker')
-rw-r--r--tests/docker/Makefile.include7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
index 8df50a0..708e3a7 100644
--- a/tests/docker/Makefile.include
+++ b/tests/docker/Makefile.include
@@ -207,7 +207,12 @@ docker-run: docker-qemu-src
$(call quiet-command, \
$(RUNC) run \
--rm \
- $(if $(NOUSER),,-u $(UID)) \
+ $(if $(NOUSER),, \
+ $(if $(filter docker,$(RUNC)), \
+ -u $(UID), \
+ --userns keep-id \
+ ) \
+ ) \
--security-opt seccomp=unconfined \
$(if $(DEBUG),-ti,) \
$(if $(NETWORK),$(if $(subst $(NETWORK),,1),--net=$(NETWORK)),--net=none) \