I'm running the ubuntu docker image from my mac. When I do docker run -it containername it starts as root. But I want to start as a user instead, I don't want to have to manually do login username
Asked
Active
Viewed 363 times
1
Dave
- 125
- 4
1 Answers
2
Run it as: docker run --interactive --tty --user $(id -u):$(id -g) containername.
You should have a user already created in dockerfile with same uid/guid.
The already posted link refers to docker daemon which is another matter.
user1452962
- 191