<p>You absolutely can do this.  However, you will need to make sure that the following is happening:</p>

<ul>
<li>Setup the Docker host on the MSSQL computer in such a way that it can reach the AD server.  Using a <a href="https://docs.docker.com/network/bridge/" rel="noreferrer">bridge network</a> may help (especially if you are using Docker for Windows).  If using Docker Toolkit you may need to look into a solution like <a href="http://woshub.com/port-forwarding-in-windows/" rel="noreferrer">port forwarding</a>.</li>
<li><a href="https://docs.docker.com/engine/reference/commandline/commit/" rel="noreferrer">Commit</a> your configuration changes to a new Docker image.  This will allow you to move the MSSQL container to a new computer or even run it with Kubernetes/Orchestration tooling.</li>
<li>Map your MSSQL container to a <a href="https://docs.docker.com/storage/volumes/" rel="noreferrer">Volume</a> for persistence.  Otherwise the data in the container will be eliminated between container restarts.</li>
</ul>

CC BY-SA 4.0
2019-08-22T11:26:43.610Z
2019-08-22T11:26:43.610Z
Wesley Rolnick
<p>As per the attached document, I see no issue with executing this task.
The one thing that you need to do update your container with a configuration that is needed to reach AD server.</p>

<p>That means those changes can be done in live SQL server container and committed or add to a Dockerfile and build.</p>

CC BY-SA 4.0
2019-08-22T10:36:42.960Z
2019-08-22T10:36:42.960Z
profesor79
<p>I am attempting to use Active Directory authentication with SQL Server on Linux running inside the official MSFT Docker container for MSSQL (<a href="https://hub.docker.com/_/microsoft-mssql-server" rel="noreferrer">https://hub.docker.com/_/microsoft-mssql-server</a>)</p>

<p>I am in the midst of working through this tutorial, but I heard from a coworker that it wouldn't work in a container. He did not say why. He did say which particular step he was doubtful about ('Join SQL Server host to AD domain')</p>

<p><a href="https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-active-directory-authentication?view=sql-server-2017" rel="noreferrer">https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-active-directory-authentication?view=sql-server-2017</a></p>

<p>Is there any reason why I can't complete the 'Join SQL Server host to AD domain' step if I'm using containers?</p>

CC BY-SA 4.0
2021-01-19T12:03:40.447Z
Were you successful, and if so how did you test it, perhaps with some kind of _impersonation_ ?
Davos
<docker><sql>
MSSQL and AD in a Docker Container
David West
# MSSQL and AD in a Docker Container

(Asked by: username_0 on 2019-08-21)

I am attempting to use Active Directory authentication with SQL Server on Linux running inside the official MSFT Docker container for MSSQL (<https://hub.docker.com/_/microsoft-mssql-server>)

I am in the midst of working through this tutorial, but I heard from a coworker that it wouldn't work in a container. He did not say why. He did say which particular step he was doubtful about ('Join SQL Server host to AD domain')

<https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-active-directory-authentication?view=sql-server-2017>

Is there any reason why I can't complete the 'Join SQL Server host to AD domain' step if I'm using containers?

**Tags:** docker, sql

> **Comments:**
> **username_1**: Were you successful, and if so how did you test it, perhaps with some kind of _impersonation_ ?  

---

## 2 answers

### Answer by username_2 on 2019-08-22. Score: 7 | Accepted answer

You absolutely can do this. However, you will need to make sure that the following is happening:

* Setup the Docker host on the MSSQL computer in such a way that it can reach the AD server. Using a [bridge network](https://docs.docker.com/network/bridge/) may help (especially if you are using Docker for Windows). If using Docker Toolkit you may need to look into a solution like [port forwarding](http://woshub.com/port-forwarding-in-windows/).
* [Commit](https://docs.docker.com/engine/reference/commandline/commit/) your configuration changes to a new Docker image. This will allow you to move the MSSQL container to a new computer or even run it with Kubernetes/Orchestration tooling.
* Map your MSSQL container to a [Volume](https://docs.docker.com/storage/volumes/) for persistence. Otherwise the data in the container will be eliminated between container restarts.


---

### Answer by username_3 on 2019-08-22. Score: 0

As per the attached document, I see no issue with executing this task.
The one thing that you need to do update your container with a configuration that is needed to reach AD server.

That means those changes can be done in live SQL server container and committed or add to a Dockerfile and build.


---

