Skip to content

Instantly share code, notes, and snippets.

@unfor19
Created February 12, 2021 13:53
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 unfor19/91710e805314d24fcdafa7b5eea631a6 to your computer and use it in GitHub Desktop.
Save unfor19/91710e805314d24fcdafa7b5eea631a6 to your computer and use it in GitHub Desktop.
mind-the-uid-gid-good-sh
# GOOD
# Reminder - My machine's UID:GID is 1000:1000
# frigga's user UID:GID - 1000:1000
$ docker run --rm -it -v $PWD/:/code/ --workdir=/code/ --entrypoint=bash unfor19/frigga
appuser@52ad885a9ad5:/code$ echo "file contents" > some-file.txt
appuser@52ad885a9ad5:/code$ ls -lh some-file.txt
# -rw-r--r-- 1 appuser appgroup 28 Feb 12 14:15 some-file.txt
appuser@52ad885a9ad5:/code$ exit
# Local machine
$ ls -lh some-file.txt
# -rw-r--r-- 1 meir meir 14 Feb 12 14:16 some-file.txt
$ echo "more contents" >> some-file.txt
# success
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment