Created
January 17, 2022 09:46
-
-
Save ThomasLeister/9bc7856ae41adc9e5c51f8a9b0714b17 to your computer and use it in GitHub Desktop.
Map a Podman container user to host user
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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