I have a docker container image that I need to run as a non-root user.
Adding the user to docker group does this, but since this gives full root control of the system to the user, I cannot use this method.
Giving sudo permissions and executing the docker run command is another way, but with sudo the ownership of the container run command is still with "root". (My need is it should list the user as the owner)
I can specify a user run time in the docker run command. With this, I see that I am able run as a non-root "inside" the container. I still have to prefix the container run command with sudo and the container is run by "root"
I cannot have the non-root user added into the Dockerfile, since the container image is not created by us.
Is there any way I can execute the docker container as non-root, without compromising security? Is there a way, that a user can be added to docker group but the privileges are limited and the user does not get full root control of the system?