Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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