Docker

Docker – MSSQL Express 2017

Source : Microsoft SQL Server by Microsoft | Docker Hub

Featured Tags

  • 2019-latest
    docker pull mcr.microsoft.com/mssql/server:2019-latest
  • 2017-latest
    docker pull mcr.microsoft.com/mssql/server:2017-latest
  • 2017-CU24-ubuntu-16.04
    docker pull mcr.microsoft.com/mssql/server:2017-CU24-ubuntu-16.04
  • 2019-CU12-ubuntu-20.04
    docker pull mcr.microsoft.com/mssql/server:2019-CU12-ubuntu-20.04

About this Image

Official container images for Microsoft SQL Server on Linux for Docker Engine.

How to use this Image

Start a mssql-server instance using the CU8 release IMPORTANT NOTE: If you are using PowerShell on Windows to run these commands use double quotes instead of single quotes.

docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=yourStrong(!)Password" -p 1433:1433 -d mcr.microsoft.com/mssql/server:2017-CU8-ubuntu

Start a mssql-server instance using the latest update for SQL Server 2017

docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=yourStrong(!)Password" -p 1433:1433 -d mcr.microsoft.com/mssql/server:2017-latest

Start a mssql-server instance running as the SQL Express edition

docker run --name MSSQLServer2017Express -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=yourStrong(!)Password" -e "MSSQL_PID=Express" -p 1433:1433 -d mcr.microsoft.com/mssql/server:2017-latest-ubuntu 

Connect to Microsoft SQL Server 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.

Configuration

Requirements

  • This image requires Docker Engine 1.8+ in any of their supported platforms.
  • At least 2GB of RAM (3.25 GB prior to 2017-CU2). 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”ACCEPT_EULA=Y””SA_PASSWORD=”MSSQL_PID=<your_product_id | edition_name> (default: Developer)”
  • A strong system administrator (SA) password: At least 8 characters including uppercase, lowercase letters, base-10 digits and/or non-alphanumeric symbols.

Environment Variables

You can use environment variables to configure SQL Server on Linux Containers.

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.

MSSQL_PID is the Product ID (PID) or Edition that the container will run with. Acceptable values:

  • Developer : This will run the container using the Developer Edition (this is the default if no MSSQL_PID environment variable is supplied)
  • Express : This will run the container using the Express Edition
  • Standard : This will run the container using the Standard Edition
  • Enterprise : This will run the container using the Enterprise Edition
  • EnterpriseCore : This will run the container using the Enterprise Edition Core

For a complete list of environment variables that can be used, refer to the documentation here.

Related Repos

SQL Server for Windows Container: microsoft/mssql-server-windows-developer SQL Server Express for Windows Containers: microsoft/mssql-server-windows-express SQL Server Command Line Tools for Linux: microsoft/mssql-tools

Full Tag Listing

Linux Images

TagsArchitectureDockerfileOsVersionCreatedTimeLastUpdatedTime
latestamd64No DockerfileUbuntu 20.0409/21/2018 01:00:1608/04/2021 16:43:07
2019-latestamd64No DockerfileUbuntu 20.0411/07/2018 05:01:1008/04/2021 16:42:22
2019-CU12-ubuntu-20.04amd64No DockerfileUbuntu 20.0408/04/2021 16:44:4908/04/2021 16:44:49
2019-CU11-ubuntu-20.04amd64No DockerfileUbuntu 20.0406/10/2021 18:59:5206/10/2021 18:59:52
2019-CU10-ubuntu-20.04amd64No DockerfileUbuntu 20.0404/06/2021 18:57:3004/06/2021 18:57:30
2019-CU12-ubuntu-18.04amd64No DockerfileUbuntu 18.0408/04/2021 16:45:0908/04/2021 16:45:09
2019-CU11-ubuntu-18.04amd64No DockerfileUbuntu 18.0406/10/2021 18:59:5606/10/2021 18:59:56
2019-CU10-ubuntu-18.04amd64No DockerfileUbuntu 18.0404/06/2021 18:57:4704/06/2021 18:57:47
2019-CU9-ubuntu-18.04amd64No DockerfileUbuntu 18.0402/11/2021 20:16:2002/11/2021 20:16:20
2019-CU8-ubuntu-18.04amd64No DockerfileUbuntu 18.0410/07/2020 17:39:4510/07/2020 17:39:45
2019-CU6-ubuntu-18.04amd64No DockerfileUbuntu 18.0408/05/2020 17:05:4708/05/2020 17:05:47
2019-CU5-ubuntu-18.04amd64No DockerfileUbuntu 18.0406/22/2020 18:21:0406/22/2020 18:21:04
2019-CU4-ubuntu-18.04amd64No DockerfileUbuntu 18.0403/31/2020 16:57:3403/31/2020 21:58:30
2019-CU3-ubuntu-18.04amd64No DockerfileUbuntu 18.0403/12/2020 22:54:5703/12/2020 22:54:57
2017-latestamd64No DockerfileUbuntu 16.0409/21/2018 01:00:2507/12/2021 06:32:07
2019-CU12-ubuntu-16.04amd64No DockerfileUbuntu 16.0408/04/2021 16:43:4708/04/2021 16:43:47
2019-CU11-ubuntu-16.04amd64No DockerfileUbuntu 16.0406/10/2021 18:58:4206/10/2021 18:58:42
2019-CU10-ubuntu-16.04amd64No DockerfileUbuntu 16.0404/06/2021 18:56:2904/06/2021 18:56:29
2019-CU8-ubuntu-16.04amd64No DockerfileUbuntu 16.0410/07/2020 17:40:2710/07/2020 17:40:27
2019-CU6-ubuntu-16.04amd64No DockerfileUbuntu 16.0408/05/2020 17:05:1008/05/2020 17:05:10
2019-CU5-ubuntu-16.04amd64No DockerfileUbuntu 16.0406/22/2020 18:21:5106/22/2020 18:21:51
2019-CU4-ubuntu-16.04amd64No DockerfileUbuntu 16.0403/31/2020 16:57:3303/31/2020 16:57:33
2019-CU3-ubuntu-16.04amd64No DockerfileUbuntu 16.0403/12/2020 22:50:3003/12/2020 22:50:30
2019-CU2-ubuntu-16.04amd64No DockerfileUbuntu 16.0402/14/2020 15:57:5202/14/2020 15:57:52
2019-CU1-ubuntu-16.04amd64No DockerfileUbuntu 16.0401/08/2020 00:14:3101/08/2020 00:14:31
2019-GDR1-ubuntu-16.04amd64No DockerfileUbuntu 16.0411/02/2019 03:57:2611/02/2019 03:57:26
2019-GA-ubuntu-16.04amd64No DockerfileUbuntu 16.0411/02/2019 02:31:2511/02/2019 02:31:25
2017-CU24-ubuntu-16.04amd64No DockerfileUbuntu 16.0405/10/2021 16:08:2405/10/2021 16:08:24
2017-CU23-ubuntu-16.04amd64No DockerfileUbuntu 16.0402/24/2021 22:15:4602/24/2021 22:15:46
2017-CU22-ubuntu-16.04amd64No DockerfileUbuntu 16.0409/10/2020 22:46:4509/10/2020 22:46:45
2017-CU21-ubuntu-16.04amd64No DockerfileUbuntu 16.0407/01/2020 19:20:3307/01/2020 19:20:33
2017-CU20-ubuntu-16.04amd64No DockerfileUbuntu 16.0404/10/2020 00:38:0004/10/2020 00:38:00
2017-CU19-ubuntu-16.04amd64No DockerfileUbuntu 16.0402/06/2020 20:21:0102/06/2020 20:21:01
2017-CU18-ubuntu-16.04amd64No DockerfileUbuntu 16.0412/09/2019 21:57:3212/09/2019 21:57:32
2017-CU17-ubuntuamd64No DockerfileUbuntu 16.0411/12/2019 20:17:4511/12/2019 20:17:45
2017-CU16-ubuntuamd64No DockerfileUbuntu 16.0408/12/2019 22:19:3008/12/2019 22:19:30
2017-CU15-ubuntuamd64No DockerfileUbuntu 16.0405/23/2019 22:30:2705/23/2019 22:30:27
2017-CU14-ubuntuamd64No DockerfileUbuntu 16.0403/25/2019 22:37:0703/25/2019 22:37:07
2017-CU13-ubuntuamd64No DockerfileUbuntu 16.0412/18/2018 18:50:2512/18/2018 18:50:25
2017-CU12-ubuntuamd64No DockerfileUbuntu 16.0410/24/2018 18:11:5710/24/2018 18:11:57
2017-CU11-ubuntuamd64No DockerfileUbuntu 16.0409/21/2018 01:00:5609/21/2018 01:00:56
2017-CU10-ubuntuamd64No DockerfileUbuntu 16.0409/13/2018 03:18:1909/13/2018 03:18:19
2017-CU9-ubuntuamd64No DockerfileUbuntu 16.0409/10/2018 23:26:1909/10/2018 23:26:19
2017-CU8-ubuntuamd64No DockerfileUbuntu 16.0409/10/2018 23:28:1409/10/2018 23:28:14
2017-CU7-ubuntuamd64No DockerfileUbuntu 16.0409/10/2018 23:30:4309/10/2018 23:30:43
2017-CU6-ubuntuamd64No DockerfileUbuntu 16.0409/10/2018 23:33:0909/10/2018 23:33:09
2017-CU5-ubuntuamd64No DockerfileUbuntu 16.0409/10/2018 23:35:0809/10/2018 23:35:08
2017-CU4-ubuntuamd64No DockerfileUbuntu 16.0409/10/2018 23:37:1909/10/2018 23:37:19
2017-CU3-ubuntuamd64No DockerfileUbuntu 16.0409/10/2018 23:39:2409/10/2018 23:39:24
2017-CU2-ubuntuamd64No DockerfileUbuntu 16.0409/10/2018 23:41:2709/10/2018 23:41:27
2017-CU1-ubuntuamd64No DockerfileUbuntu 16.0409/10/2018 23:43:1209/10/2018 23:43:12
2017-GDR-ubuntuamd64No DockerfileUbuntu 16.0409/10/2018 23:45:2909/10/2018 23:45:29
2017-GA-ubuntuamd64No DockerfileUbuntu 16.0409/10/2018 23:52:4809/10/2018 23:52:48

You can retrieve a list of all available tags for mssql/server at https://mcr.microsoft.com/v2/mssql/server/tags/list

Notes:

  • GA = General Availability – when the version is officially available and supported.
  • CU = Cumulative Update – a periodic release that includes bug fixes, security fixes, and occasionally a small feature.
  • CTP = Community Technology Preview – a preview release that precedes the GA of an upcoming new version.
  • GDR = General Distribution Release – a release that contains ONLY security fixes.

Support

View issues on the mssql-docker GitHub Project.

Known Issues

  • Mounting a volume does not work on Docker for Mac

License

By passing the value “Y” to the environment variable “ACCEPT_EULA”, you are expressing that you have a valid and existing license for the edition and version of SQL Server that you intend to use. You also agree that your use of SQL Server software running in a Docker container image will be governed by the terms of your SQL Server license.

To specify the edition, use the MSSQL_PID environment variable. Details can be found in the “Environment Variables” section below.

SQL Server Developer edition lets developers build any kind of application on top of SQL Server. It includes all the functionality of Enterprise edition, but is licensed for use as a development and test system, not as a production server. SQL Server Developer Edition cannot be used in a production environment. The SQL Server 2017 Developer Edition license terms are located here.