SQL Server on Docker in Ubuntu 16.04

Thiago S. Adriano
dockerbr
Published in
2 min readJun 11, 2017

Today we’ll see how can we create a container Docker with SQL Server on Ubuntu 16.04.

The first step we need to pull the SQL image from docker hub, the command below show this step:

docker pull microsoft/mssql-server-linux

After executed the command above, you can can execute this command to see your new image docker images, it will show all imagens in your machine, in this case we can see something like this image below:

docker run --name sqlserver2017 -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=SqlOnDocker' -p 11433:1433 -v "path to your volume":/var/opt/mssql -d microsoft/mssql-server-linux

Let’s go to understand this command above:

  • name is our container name
  • -e we can config our password in this case: SqlOnDocker
  • -v path to our volume, there we’ll save our data in host disk
  • -d set our sql image to container

Now with the command docker ps -a we can see our container running.

Now we have a container with SQL Server :)

--

--