File tree 1 file changed +8
-1
lines changed
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,14 @@ mkdir -p out/
61
61
# we run all builds with non-privileged user accounts to make sure the build doesn't depend on such features
62
62
uid=" $( id -u) "
63
63
64
+ # When running under Podman (on hosts where `docker` is a shim that invokes `podman`),
65
+ # UID/GID mappings may lead to permission errors when copying artifacts to `/out`.
66
+ # We set the user namespace mode to `keep-id` to make sure that the host UID/GID
67
+ # are mapped to the same values inside the container, but using this environment
68
+ # variable (a) to not affect builds using Docker, and (b) to allow overriding the
69
+ # user namespace mode easily if necessary.
70
+ export PODMAN_USERNS=" ${PODMAN_USERNS:- keep-id} "
71
+
64
72
# note: we cannot just use '-e ARCH', as this wouldn't overwrite the value set via ENV ARCH=... in the image
65
73
common_docker_opts=(
66
74
-e TERM=" $TERM "
79
87
# TODO: make gnupg home available, e.g., through "-v" "$HOME"/.gnupg:/root/.gnupg
80
88
# TODO: this ^ won't work since we don't build as root any more
81
89
# note: we enforce using the same UID in the container as outside, so that the created files are owned by the caller
82
- env PODMAN_USERNS=${PODMAN_USERNS:- keep-id} \
83
90
docker run --rm \
84
91
--user " $uid " \
85
92
" ${common_docker_opts[@]} " \
You can’t perform that action at this time.
0 commit comments