Skip to content

Instantly share code, notes, and snippets.

@alexgarel
Created October 8, 2021 16:31
Show Gist options
  • Save alexgarel/6e6158ee869d6db2192e0441fd58576e to your computer and use it in GitHub Desktop.
Save alexgarel/6e6158ee869d6db2192e0441fd58576e to your computer and use it in GitHub Desktop.
Getting developper uid for docker

When you develop with docker and use bind mounts, you may encounter problems if you do ont align the uid / gid of the user in docker with teh uid / gid of your user. For this purpose, some Dockerfile propose an ARG so that you can pass in the UID/GID you need.

But how to find the right id to give ?

On linux, simply run: id

On windows, according to this stackoverflow contribution you should open a command window and run: for /F "tokens=1,2 delims=: " %A in ('WhoAmI /USER /FO LIST') do @if /I "%~A" == "SID" echo %B

On Mac FIXME !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment