Skip to content

Instantly share code, notes, and snippets.

@camallen
Last active August 9, 2024 04:45
Show Gist options
  • Save camallen/4c5a15a10743057331ad8ee2833cd403 to your computer and use it in GitHub Desktop.
Save camallen/4c5a15a10743057331ad8ee2833cd403 to your computer and use it in GitHub Desktop.
How to run a cmd in docker as a different or root user
# docker
docker exec -it -u0 containerid bash
# compose
docker compose run --rm -u0 serviceid bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment