Microsoft SQL Server on Linux for Docker Engine. Learn more about the latest release of SQL Server on Linux here: SQL Server on Linux Documentation. For any questions or issues, please contact us through a GitHub issue.
- Dockerfile: mssql-server-linux:latest
Additional Microsoft SQL Server Docker Images
- SQL Server for Windows Containers: microsoft/mssql-server-windows
- SQL Server Express for Windows Containers: microsoft/mssql-server-windows-express
- This image requires Docker Engine 1.8+ in any of their supported platforms.
- At least 3.25 GB of RAM. Make sure to assign enough memory to the Docker VM if you're running on Docker for Mac or Windows.
- Requires the following environment flags
- A strong system administrator (SA) password: At least 8 characters including uppercase, lowercase letters, base-10 digits and/or non-alphanumeric symbols.
How to use this image
Start a mssql-server instance
docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=yourStrong(!)Password' -p 1433:1433 -d microsoft/mssql-server-linux
Connect to Microsoft SQL Server
Starting with the CTP 1.4 (March 17, 2017) release the mssql-tools package including sqlcmd, bcp are included in the image. You can connect to the SQL Server using the sqlcmd tool inside of the container by using the following command on the host:
docker exec -it <container_id|container_name> /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P <your_password>
You can also use the tools in an entrypoint.sh script to do things like create databases or logins, attach databases, import data, or other setup tasks. See this example of using an entrypoint.sh script to create a database and schema and bcp in some data.
You can connect to the SQL Server instance in the container from outside the container by using various command line and GUI tools on the host or remote computers. See the Connect and Query topic in the SQL Server on Linux documentation.
- ACCEPT_EULA confirms your acceptance of the End-User Licensing Agreement.
- SA_PASSWORD is the database system administrator (userid = 'sa') password used to connect to SQL Server once the container is running. Important note: This password needs to include at least 8 characters of at least three of these four categories: uppercase letters, lowercase letters, numbers and non-alphanumeric symbols.
By passing the value "Y" to the environment variable "ACCEPT_EULA", you are expressing your acceptance of the End-User License Agreement.
- For issues with or questions about this image, please contact us through a GitHub issue.
- SQL Server on Linux for Docker documentation.
- SQL Server - Developer Getting Started Tutorials.
- SQL Server Docker GitHub Repository
@shammishailaj - It is most likely that you do not have enough memory allocated to the Xhyve VM that is running the Docker Engine. By default on Docker for Mac it is only 2 GB. Please change the memory allocation to 4 GB in the Docker settings and try again.
I am unable to get the daemon running. I executed the following command:
docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=pwdppp123' -p 1433:1433 -d microsoft/mssql-server-linux
but the command executes and then exits.
When I do a:
I do not see the container running. How do I fix this?
I am using MacOS X.
uname -a yields:
Darwin MacBook-Pro.local 16.6.0 Darwin Kernel Version 16.6.0: Wed Apr 12 21:00:08 PDT 2017; root:xnu-37220.127.116.11.1~3/RELEASE_X86_64 x86_64
@srueff - Sorry about that. we missed a merge in the build process. We'll update the image with tools tomorrow. RE: the SSMS issue, probably better if you file an issue on the mssql-docker GitHub so we can have a threaded conversation there. Let us know what error message you are getting.
I got the docker image working w/o any issues, but the tools were not on the image I pulled @ 1p today. After some trial and error, I was able to download them separately and everything works great inside the container itself.
However, I'm unable to connect SQL Server Management Studio to the Linux container running on Virtual Box.
@tberne - Please use the mssql-server-linux image for now. We are still finalizing the plans for how editions are handled in Linux images right now. The mssql-server-linux image is still pre-GA software until we get to SQL Server vNext GA.
Could you please add a SQL Server Express Linux image?
I would like to have that to build my development environment with docker-compose (using SQL Server Express and all other services I need).
Heads up everybody! :latest (CTP 1.4) now include the mssql-tools package in the image. Now you can easily use sqlcmd or bcp without having to separately install them.