Skip to content

Instantly share code, notes, and snippets.

@swarupdonepudi
Last active January 22, 2018 16:25
Show Gist options
  • Save swarupdonepudi/3d2a3e5a74a40a263bb7f40332e7ac97 to your computer and use it in GitHub Desktop.
Save swarupdonepudi/3d2a3e5a74a40a263bb7f40332e7ac97 to your computer and use it in GitHub Desktop.
Run docker as the same user as on the host machine

By default docker runs the container as root user unless specified otherwise. In order to force docker to run the container as the same user as the docker daemon add --user flag as show below to docker run command.

docker run --user "$(id -u):$(id -g)" 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment