Docker Community Forums

Share and learn in the Docker community.

Running Docker app with reduced privileges

OS : Windows 10 Pro

I am trying to run a Docker image (tensorflow/tensorflow) that I downloaded from DockerHub . The pull went ok, but when t tried to run it did run, but it gave me a warning that it is now in root mode and this is clearly something to avoid.

I have worked enough in Linux and Unix to know to avoid root user unless you want to make changes in the operating system itself. I clearly do not want to run tensorflow/tensorflow as root.

The way that a I found to do this is

Docker run -it m -u 9000 tensorflow/tensorflow

as opposed to

Docker run -it tensorflow/tensorflow

The second command starting tensorflow/tensorflow in root mode.

The first command starting tensorflow/tensorflow in user mode.

However, the second command only works if the uid of 9000 is in the Docker user group.

It states clearly how to do this in Ubuntu, but it is not clear how to do this in Windows 10 Pro.

Now does not this have to be in Docker’s user group? If so, then how do I put it in.

By doing that I assume that I can run tensorflow/tensorflow in reduced privileges mode
and avoid running it as root user.

How do I it in Windows 10?

Any help appreciated. Thanks in advance.

Respectfully,

ErnestTBass

I found that when I run the command:

Docker run -it m -u 9000 tensorflow/tensorflow

I come in t the Docker container with reduced privileges which is what I want. I put nothing into the Docker user group because I simply do not know how to do it.

But, still, how do I get my UID into the Docker user group for Windows 10?

Respectfully,

ErnestTBass

Here is how I did it. I made a Windows group and added all the Windows users needing access into it. Then

Create 'C:\ProgramData\Docker\config\daemon.json' if it does not exist
Add this to that file:
       {
     "group" : "<name of your Windows User Group>"
       }

So if you named your group MyDockerGroup the line would be:
“group” : “MyDockerGroup”