Last active
January 21, 2024 08:57
-
-
Save glehmann/3d5d416bc76e3bb1fcad6eaaa0be86bb to your computer and use it in GitHub Desktop.
creating files with the expected uid/gid in a docker local volume
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
glehmann@gbook:/tmp/test$ docker run -v .:/app alpine touch /app/foo | |
glehmann@gbook:/tmp/test$ ls -lh | |
total 0 | |
-rw-r--r-- 1 root root 0 janv. 21 09:48 foo | |
glehmann@gbook:/tmp/test$ docker run -u $(id -u):$(id -g) -v .:/app alpine touch /app/bar | |
glehmann@gbook:/tmp/test$ ls -lh | |
total 0 | |
-rw-r--r-- 1 glehmann glehmann 0 janv. 21 09:48 bar | |
-rw-r--r-- 1 root root 0 janv. 21 09:48 foo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment