Docker

Windows Docker Containers using GMSA to connect to SQL Server – Part 2

Windows Docker Containers using GMSA to connect to SQL Server – Part 2

This is a continuation of the previous blog post on GMSA setup.


Step 1: Create Docker Image
  1. I have created ASPNET MVC app and it accessing the SQL server using windows authentication.
  2. My Connection string looks like below.
  3. I have created the Docker file and necessary build folders using image2docker. Refer Image2Docker

  4. Docker file looks like below
  5. Move the necessary files to cloud-2016.
  6. Login to the cloud-2016 server.
  7. Create the image using the below commands. Refer Docker commands.
Step 2: Create Container
  1. when you are creating docker container you need to specify the additional configuration to utilize GMSA. Please execute below commands
  2. Or execute the commands below
  3. Browse the appropriate page, you can see DB records.
  4. You can test the Active directory communication below. 
    1. Login into running docker container using docker exec command and check if, in fact, you can communicate to Active Directory. Execute nltest /parentdomain to verify