Skip to content

Instantly share code, notes, and snippets.

@7rin0
Created March 3, 2017 01:52
Show Gist options
  • Star 17 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save 7rin0/ea890d2d4bf25a890b86aff01290e7d0 to your computer and use it in GitHub Desktop.
Save 7rin0/ea890d2d4bf25a890b86aff01290e7d0 to your computer and use it in GitHub Desktop.
Docker exec root or default user
# Root.
$ docker exec -u 0 i -t {container_id/image_name} bash
or
# Default container's user.
$ docker exec i -t {container_id/image_name} bash
@namminhlp
Copy link

Thank you! But #Root line should be:
$ docker exec -u 0 -it {container_id/image_name} bash

@YounggilLee
Copy link

Thanks!!

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