Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ThomasLeister/9bc7856ae41adc9e5c51f8a9b0714b17 to your computer and use it in GitHub Desktop.
Save ThomasLeister/9bc7856ae41adc9e5c51f8a9b0714b17 to your computer and use it in GitHub Desktop.
Map a Podman container user to host user
#
# Use case: Podman should run a build-container.
# The build should be run by a user "builder" with UID 1000 inside the container
# Build artifacts should be shared with the host via a -v Volume.
# To make things easier, artifacts created inside the container should have the user, who started the container, as owner.
# The Container should run in "rootless" mode.
# Solution: Use --uidmap for user mapping.
#
podman run \
--user 1000 \
--uidmap=1000:0:1 \
--uidmap=0:1:1000 \
-v [...]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment