Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Needed example of a docker run --user on a windows server running docker

Tags:

docker

On my windows server 2016, I am trying to figure out the run command syntax to run a docker image as a user in my ldap. I read this article, but I am not following it very well (different environments)

Perhaps I am miss understanding the concept all together, but in the end I need to run the container as a specific user in our active directory.

Any links to a well documented run --user examples would be appreciated...

One of the things that is confusing is trying to figure out the UserId and such...

like image 744
Warren LaFrance Avatar asked Jun 12 '18 15:06

Warren LaFrance


People also ask

What user does docker run as on Windows?

Unlike the Linux Docker engine and containers which run in a VM, Windows containers are an operating system feature, and run directly on the Windows host with Administrator privileges.

Can you run docker on Windows Server?

By default, Docker on Windows machine can only run Windows container. In order to use Linux containers on Windows Server, you need to use the Docker Enterprise Edition Preview which includes a full LinuxKit system for running Docker Linux containers.

Which user is running a docker container?

You can check the user that the application inside the container is configured to run as by inspecting the container for the . Config. User field, and if it's blank the default is uid 0 (root).


1 Answers

The answer depends on the use case, but may be gMSA authentication would help? Basically, with gMSA authentication, you can add the host OS to an AD domain, and containers running on it can share the privileges to use things like network drive. That way, you don't need to pass credential every time you access them.

MS team has a good write up on it here:

Active Directory Service Accounts for Windows Containers https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-containers/manage-serviceaccounts

Also, artisticcheese has fantastic walk through.

Enabling integrated Windows Authentication in windows docker container https://artisticcheese.wordpress.com/2017/09/09/enabling-integrated-windows-authentication-in-windows-docker-container/

Hope this helps.

like image 188
eiichi Avatar answered Jan 02 '23 08:01

eiichi