1

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

Dave
  • 125
  • 4

1 Answers1

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.