| title | Run the SQL Server Docker image on Linux, Mac, or Windows - SQL Server vNext CTP1 | Microsoft Docs |
|---|---|
| description | |
| author | rothja |
| ms.author | jroth |
| manager | jhubbard |
| ms.date | 11/15/2016 |
| ms.topic | article |
| ms.prod | sql-linux |
| ms.technology | database-engine |
| ms.assetid | 82737f18-f5d6-4dce-a255-688889fdde69 |
This topic explains how to pull and run the mssql-server Docker image. This image can be used with the Docker Engine 1.8+ on Linux or on Docker for Mac/Windows.
- Docker Engine 1.8+ on any supported Linux distribution or Docker for Mac/Windows.
- Minimum of 4 GB of disk space
- Minimum of 4 GB of RAM
Important
The default on Docker for Mac and Docker for Windows is 2 GB for the Moby VM, so you will need to change it to 4 GB. The following sections explain how.
- Click on the Docker logo on the top status bar.
- Select Preferences.
- Move the memory indicator to 4GB or more.
- Click the restart button at the button of the screen.
- Right-click on the Docker icon from the task bar.
- Click Settings under that menu.
- Click on the Advanced Tab.
- Move the memory indicator to 4GB or more.
- Click the Apply button.
-
Pull the Docker image from Docker Hub.
$ sudo docker pull microsoft/mssql-server-linux:latest -
To run the Docker image, you can use the following commands:
$ sudo docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=your_password_here" -p 1433:1433 -d microsoft/mssql-server-linux:latest -
To persist the data generated from your Docker container, you must map volume to the host machine. To do that, use the run command with the -v <host_folder>:/var/opt/mssql flag. This will allow the data to be restored between container executions.
$ sudo docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=your_password_here" -p 1433:1433 -v \<host folder\>:/var/opt/mssql -d private-repo.microsoft.com/mssql-private-preview/mssql- server:latest[!NOTE] The ACCEPT_EULA and SA_PASSWORD environment variables are required to run the image.
After installing SQL Server on Linux, next see how to connect to the server and run basic Transact-SQL queries.