Introducing our new CEO Don Johnson - Read More

Microsoft SQL Server - Ubuntu based images

Verified Publisher

mssql/server

By Microsoft

Updated 9 months ago

Official images for Microsoft SQL Server based on Ubuntu

137

Featured Tags

  • 2022-latest
    docker pull mcr.microsoft.com/mssql/server:2022-latest

  • 2019-latest
    docker pull mcr.microsoft.com/mssql/server:2019-latest

  • 2017-latest
    docker pull mcr.microsoft.com/mssql/server:2017-latest

Note Starting with SQL Server 2022 CU 14, we are updating SQL Server 2022 container images to include the new mssql-tools18 package. With the introduction of SQL Server 2022 CU 14, and in all future container images, the previous directory /opt/mssql-tools/bin will be phased out. The new directory for Microsoft ODBC 18 tools will be '/opt/mssql-tools18/bin', aligning with the latest tools offering. For additional details on all the changes and security enhancements, please refer to the blog post ODBC Driver 18.0 for SQL Server Released - Microsoft Community Hub. This new iteration, ODBC driver version 18, is designed with an ‘encryption-first’ approach, ensuring that utilities like sqlcmd and bcp that utilize the Microsoft ODBC driver will operate under the ‘secure by default’ principle. Users who wish to disable encryption will need to do so explicitly.

For example when trying to connect using the sqlcmd tool, the -N option is available with [s|m|o] parameters, where ‘s’ stands for strict, ‘m’ for mandatory, and ‘o’ for optional. The default setting is mandatory. For more information refer : Connecting with sqlcmd - ODBC Driver for SQL Server . To connect without encryption, the sample command would be:

sqlcmd -S <ip address,port> -U <login_name> -P <yourpassword> -No

Related Repositories

The program for SQL Server Windows Container was suspended in 2021. For more information, see Update on Beta program for SQL Server on Windows Container. SQL Server Windows Container is not supported for production workloads. For development purposes, if you still need references for a custom SQL Server container image on Windows, provided as-is and not supported, see SQL Server Windows Containers sample.

About this Image

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

How to use this Image

You can now get started with the SQL Server 2022 on Ubuntu 22.04 which is currently in preview. To deploy a container with SQL Server 2022 based on Ubuntu 22.04 please use the below command:

docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=yourStrong(!)Password" -e "MSSQL_PID=Evaluation" -p 1433:1433  --name sqlpreview --hostname sqlpreview -d mcr.microsoft.com/mssql/server:2022-preview-ubuntu-22.04

Start a mssql-server instance for SQL Server 2022, which is now generally available (GA). These images are based on Ubuntu 20.04 and is fully supported for production workload.

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

Start a mssql-server instance using a CU tag, in this example we use the CU 14 for SQL 2019 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 "MSSQL_SA_PASSWORD=yourStrong(!)Password" -p 1433:1433 -d mcr.microsoft.com/mssql/server:2019-CU14-ubuntu-20.04

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

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

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

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

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 and setup.sql scripts to create a database.

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"

    "MSSQL_SA_PASSWORD=<your_strong_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.

MSSQL_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 : This will run the container with the edition that is associated with the PID

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

Related Repos

The Beta program for SQL Server Windows Container was suspended in the year 2021 as updated here: Update on Beta program for SQL Server on Windows Container, thus it is not supported for Production workload. For development purpose, if you still need references for a custom SQL Server container image on Windows please refer the link below, this is provided 'as-is' and thus not supported : SQL Server Windows Containers sample

Full Tag Listing

Linux Images
TagsArchitectureDockerfileOsVersionCreatedTimeLastUpdatedTime
latestamd64No DockerfileUbuntu 22.0409/21/201801/16/2025
2022-latestamd64No DockerfileUbuntu 22.0405/31/202201/16/2025
2022-CU17-ubuntu-22.04amd64No DockerfileUbuntu 22.0401/16/202501/16/2025
2022-CU16-ubuntu-22.04amd64No DockerfileUbuntu 22.0411/14/202411/14/2024
2022-CU15-GDR2-ubuntu-22.04amd64No DockerfileUbuntu 22.0411/12/202411/12/2024
2022-CU15-GDR1-ubuntu-22.04amd64No DockerfileUbuntu 22.0410/08/202410/08/2024
2022-CU15-ubuntu-22.04amd64No DockerfileUbuntu 22.0409/25/202409/25/2024
2022-CU14-GDR1-ubuntu-22.04amd64No DockerfileUbuntu 22.0409/10/202409/10/2024
2022-CU14-ubuntu-22.04amd64No DockerfileUbuntu 22.0407/23/202407/23/2024
2022-CU13-ubuntu-22.04amd64No DockerfileUbuntu 22.0405/16/202405/16/2024
2022-CU12-GDR1-ubuntu-22.04amd64No DockerfileUbuntu 22.0404/09/202404/09/2024
2022-CU12-ubuntu-22.04amd64No DockerfileUbuntu 22.0403/14/202403/14/2024
2022-CU11-ubuntu-22.04amd64No DockerfileUbuntu 22.0401/11/202401/11/2024
2022-CU10-GDR1-ubuntu-22.04amd64No DockerfileUbuntu 22.0401/09/202401/09/2024
2022-CU10-ubuntu-22.04amd64No DockerfileUbuntu 22.0411/16/202311/16/2023
2022-CU17-ubuntu-20.04amd64No DockerfileUbuntu 20.0401/16/202501/16/2025
2022-CU16-ubuntu-20.04amd64No DockerfileUbuntu 20.0411/14/202411/14/2024
2022-CU15-GDR2-ubuntu-20.04amd64No DockerfileUbuntu 20.0411/12/202411/12/2024
2022-CU15-GDR1-ubuntu-20.04amd64No DockerfileUbuntu 20.0410/08/202410/08/2024
2022-CU15-ubuntu-20.04amd64No DockerfileUbuntu 20.0409/25/202409/25/2024
2022-CU14-ubuntu-20.04amd64No DockerfileUbuntu 20.0407/23/202407/23/2024
2022-CU13-ubuntu-20.04amd64No DockerfileUbuntu 20.0405/16/202405/16/2024
2022-CU12-GDR1-ubuntu-20.04amd64No DockerfileUbuntu 20.0404/09/202404/09/2024
2022-CU12-ubuntu-20.04amd64No DockerfileUbuntu 20.0403/14/202403/14/2024
2022-CU11-ubuntu-20.04amd64No DockerfileUbuntu 20.0401/11/202401/11/2024
2022-CU10-GDR1-ubuntu-20.04amd64No DockerfileUbuntu 20.0401/09/202401/09/2024
2022-CU10-ubuntu-20.04amd64No DockerfileUbuntu 20.0411/16/202311/16/2023
2022-CU9-ubuntu-20.04amd64No DockerfileUbuntu 20.0410/12/202310/12/2023
2022-CU8-GDR1-ubuntu-20.04amd64No DockerfileUbuntu 20.0410/10/202310/10/2023
2022-CU8-ubuntu-20.04amd64No DockerfileUbuntu 20.0409/15/202309/15/2023
2022-CU7-ubuntu-20.04amd64No DockerfileUbuntu 20.0408/10/202308/10/2023
2022-CU6-ubuntu-20.04amd64No DockerfileUbuntu 20.0407/13/202307/13/2023
2022-CU5-ubuntu-20.04amd64No DockerfileUbuntu 20.0406/15/202306/15/2023
2022-CU4-ubuntu-20.04amd64No DockerfileUbuntu 20.0405/11/202305/11/2023
2022-CU3-ubuntu-20.04amd64No DockerfileUbuntu 20.0404/13/202304/13/2023
2022-RTM-CU2-ubuntu-20.04amd64No DockerfileUbuntu 20.0403/15/202303/15/2023
2022-RTM-CU1-ubuntu-20.04amd64No DockerfileUbuntu 20.0402/16/202302/16/2023
2022-RTM-GDR1-ubuntu-20.04amd64No DockerfileUbuntu 20.0402/14/202302/14/2023
2019-latestamd64No DockerfileUbuntu 20.0411/07/201812/12/2024
2019-CU30-ubuntu-20.04amd64No DockerfileUbuntu 20.0412/12/202412/12/2024
2019-CU29-GDR1-ubuntu-20.04amd64No DockerfileUbuntu 20.0411/12/202411/12/2024
2019-CU29-ubuntu-20.04amd64No DockerfileUbuntu 20.0410/31/202410/31/2024
2019-CU28-GDR2-ubuntu-20.04amd64No DockerfileUbuntu 20.0410/08/202410/08/2024
2019-CU28-GDR1-ubuntu-20.04amd64No DockerfileUbuntu 20.0409/10/202409/10/2024
2019-CU28-ubuntu-20.04amd64No DockerfileUbuntu 20.0408/01/202408/01/2024
2019-CU27-ubuntu-20.04amd64No DockerfileUbuntu 20.0406/13/202406/13/2024
2019-CU26-ubuntu-20.04amd64No DockerfileUbuntu 20.0404/11/202404/11/2024
2019-CU25-GDR1-ubuntu-20.04amd64No DockerfileUbuntu 20.0404/09/202404/09/2024
2019-CU25-ubuntu-20.04amd64No DockerfileUbuntu 20.0402/15/202402/15/2024
2019-CU24-ubuntu-20.04amd64No DockerfileUbuntu 20.0412/14/202312/14/2023
2019-CU23-ubuntu-20.04amd64No DockerfileUbuntu 20.0410/12/202310/12/2023
2019-CU22-GDR1-ubuntu-20.04amd64No DockerfileUbuntu 20.0410/10/202310/10/2023
2019-CU22-ubuntu-20.04amd64No DockerfileUbuntu 20.0408/14/202308/14/2023
2019-CU21-ubuntu-20.04amd64No DockerfileUbuntu 20.0406/15/202306/15/2023
2019-CU20-ubuntu-20.04amd64No DockerfileUbuntu 20.0404/13/202304/13/2023
2019-CU19-ubuntu-20.04amd64No DockerfileUbuntu 20.0402/16/202302/16/2023
2019-CU18-GDR1-ubuntu-20.04amd64No DockerfileUbuntu 20.0402/14/202302/14/2023
2019-CU18-ubuntu-20.04amd64No DockerfileUbuntu 20.0409/28/202209/28/2022
2019-CU17-ubuntu-20.04amd64No DockerfileUbuntu 20.0408/11/202208/11/2022
2019-CU16-GDR1-ubuntu-20.04amd64No DockerfileUbuntu 20.0406/14/202206/14/2022
2019-CU16-ubuntu-20.04amd64No DockerfileUbuntu 20.0405/17/202205/17/2022
2019-CU15-ubuntu-20.04amd64No DockerfileUbuntu 20.0401/27/202201/27/2022
2019-CU14-ubuntu-20.04amd64No DockerfileUbuntu 20.0411/22/202111/22/2021
2019-CU13-ubuntu-20.04amd64No DockerfileUbuntu 20.0410/05/202110/05/2021
2019-CU12-ubuntu-20.04amd64No DockerfileUbuntu 20.0408/04/202108/04/2021
2019-CU11-ubuntu-20.04amd64No DockerfileUbuntu 20.0406/10/202106/10/2021
2019-CU10-ubuntu-20.04amd64No DockerfileUbuntu 20.0404/06/202104/06/2021
2019-CU20-ubuntu-18.04amd64No DockerfileUbuntu 18.0404/13/202304/13/2023
2019-CU19-ubuntu-18.04amd64No DockerfileUbuntu 18.0402/16/202302/16/2023
2019-CU18-GDR1-ubuntu-18.04amd64No DockerfileUbuntu 18.0402/14/202302/14/2023
2019-CU18-ubuntu-18.04amd64No DockerfileUbuntu 18.0409/28/202209/28/2022
2019-CU17-ubuntu-18.04amd64No DockerfileUbuntu 18.0408/11/202208/11/2022
2019-CU16-GDR1-ubuntu-18.04amd64No DockerfileUbuntu 18.0406/14/202206/14/2022
2019-CU16-ubuntu-18.04amd64No DockerfileUbuntu 18.0405/17/202205/17/2022
2019-CU15-ubuntu-18.04amd64No DockerfileUbuntu 18.0401/27/202201/27/2022
2019-CU14-ubuntu-18.04amd64No DockerfileUbuntu 18.0411/22/202111/22/2021
2019-CU13-ubuntu-18.04amd64No DockerfileUbuntu 18.0410/05/202110/05/2021
2019-CU12-ubuntu-18.04amd64No DockerfileUbuntu 18.0408/04/202108/04/2021
2019-CU11-ubuntu-18.04amd64No DockerfileUbuntu 18.0406/10/202106/10/2021
2019-CU10-ubuntu-18.04amd64No DockerfileUbuntu 18.0404/06/202104/06/2021
2019-CU9-ubuntu-18.04amd64No DockerfileUbuntu 18.0402/11/202102/11/2021
2019-CU8-ubuntu-18.04amd64No DockerfileUbuntu 18.0410/07/202010/07/2020
2019-CU6-ubuntu-18.04amd64No DockerfileUbuntu 18.0408/05/202008/05/2020
2019-CU5-ubuntu-18.04amd64No DockerfileUbuntu 18.0406/22/202006/22/2020
2019-CU4-ubuntu-18.04amd64No DockerfileUbuntu 18.0403/31/202003/31/2020
2019-CU3-ubuntu-18.04amd64No DockerfileUbuntu 18.0403/12/202003/12/2020
2017-latestamd64No DockerfileUbuntu 18.0409/21/201811/12/2024
2017-CU31-GDR2-ubuntu-18.04amd64No DockerfileUbuntu 18.0410/10/202310/10/2023
2017-CU31-GDR1-ubuntu-18.04amd64No DockerfileUbuntu 18.0402/15/202302/15/2023
2017-CU31-ubuntu-18.04amd64No DockerfileUbuntu 18.0409/20/202209/20/2022
2017-CU30-ubuntu-18.04amd64No DockerfileUbuntu 18.0407/13/202209/20/2022
2019-CU16-GDR1-ubuntu-16.04amd64No DockerfileUbuntu 16.0406/14/202206/14/2022
2019-CU16-ubuntu-16.04amd64No DockerfileUbuntu 16.0405/17/202205/17/2022
2019-CU15-ubuntu-16.04amd64No DockerfileUbuntu 16.0401/27/202201/27/2022
2019-CU14-ubuntu-16.04amd64No DockerfileUbuntu 16.0411/22/202111/22/2021
2019-CU13-ubuntu-16.04amd64No DockerfileUbuntu 16.0410/05/202110/05/2021
2019-CU12-ubuntu-16.04amd64No DockerfileUbuntu 16.0408/04/202108/04/2021
2019-CU11-ubuntu-16.04amd64No DockerfileUbuntu 16.0406/10/202106/10/2021
2019-CU10-ubuntu-16.04amd64No DockerfileUbuntu 16.0404/06/202104/06/2021
2019-CU8-ubuntu-16.04amd64No DockerfileUbuntu 16.0410/07/202010/07/2020
2019-CU6-ubuntu-16.04amd64No DockerfileUbuntu 16.0408/05/202008/05/2020
2019-CU5-ubuntu-16.04amd64No DockerfileUbuntu 16.0406/22/202006/22/2020
2019-CU4-ubuntu-16.04amd64No DockerfileUbuntu 16.0403/31/202003/31/2020
2019-CU3-ubuntu-16.04amd64No DockerfileUbuntu 16.0403/12/202003/12/2020
2019-CU2-ubuntu-16.04amd64No DockerfileUbuntu 16.0402/14/202002/14/2020
2019-CU1-ubuntu-16.04amd64No DockerfileUbuntu 16.0401/08/202001/08/2020
2019-GDR1-ubuntu-16.04amd64No DockerfileUbuntu 16.0411/02/201911/02/2019
2019-GA-ubuntu-16.04amd64No DockerfileUbuntu 16.0411/02/201911/02/2019
2017-CU29-GDR1-ubuntu-16.04amd64No DockerfileUbuntu 16.0406/14/202206/14/2022
2017-CU29-ubuntu-16.04amd64No DockerfileUbuntu 16.0403/30/202203/30/2022
2017-CU28-ubuntu-16.04amd64No DockerfileUbuntu 16.0401/13/202201/13/2022
2017-CU27-ubuntu-16.04amd64No DockerfileUbuntu 16.0410/28/202110/28/2021
2017-CU26-ubuntu-16.04amd64No DockerfileUbuntu 16.0409/14/202109/14/2021
2017-CU25-ubuntu-16.04amd64No DockerfileUbuntu 16.0407/12/202107/12/2021
2017-CU24-ubuntu-16.04amd64No DockerfileUbuntu 16.0405/10/202105/10/2021
2017-CU23-ubuntu-16.04amd64No DockerfileUbuntu 16.0402/24/202102/24/2021
2017-CU22-ubuntu-16.04amd64No DockerfileUbuntu 16.0409/10/202009/10/2020
2017-CU21-ubuntu-16.04amd64No DockerfileUbuntu 16.0407/01/202007/01/2020
2017-CU20-ubuntu-16.04amd64No DockerfileUbuntu 16.0404/10/202004/10/2020
2017-CU19-ubuntu-16.04amd64No DockerfileUbuntu 16.0402/06/202002/06/2020
2017-CU18-ubuntu-16.04amd64No DockerfileUbuntu 16.0412/09/201912/09/2019
2017-CU17-ubuntuamd64No DockerfileUbuntu 16.0411/12/201911/12/2019
2017-CU16-ubuntuamd64No DockerfileUbuntu 16.0408/12/201908/12/2019
2017-CU15-ubuntuamd64No DockerfileUbuntu 16.0405/23/201905/23/2019
2017-CU14-ubuntuamd64No DockerfileUbuntu 16.0403/25/201903/25/2019
2017-CU13-ubuntuamd64No DockerfileUbuntu 16.0412/18/201812/18/2018
2017-CU12-ubuntuamd64No DockerfileUbuntu 16.0410/24/201810/24/2018
2017-CU11-ubuntuamd64No DockerfileUbuntu 16.0409/21/201809/21/2018
2017-CU10-ubuntuamd64No DockerfileUbuntu 16.0409/13/201809/13/2018
2017-CU9-ubuntuamd64No DockerfileUbuntu 16.0409/10/201809/10/2018
2017-CU8-ubuntuamd64No DockerfileUbuntu 16.0409/10/201809/10/2018
2017-CU7-ubuntuamd64No DockerfileUbuntu 16.0409/10/201809/10/2018
2017-CU6-ubuntuamd64No DockerfileUbuntu 16.0409/10/201809/10/2018
2017-CU5-ubuntuamd64No DockerfileUbuntu 16.0409/10/201809/10/2018
2017-CU4-ubuntuamd64No DockerfileUbuntu 16.0409/10/201809/10/2018
2017-CU3-ubuntuamd64No DockerfileUbuntu 16.0409/10/201809/10/2018
2017-CU2-ubuntuamd64No DockerfileUbuntu 16.0409/10/201809/10/2018
2017-CU1-ubuntuamd64No DockerfileUbuntu 16.0409/10/201809/10/2018
2017-GDR-ubuntuamd64No DockerfileUbuntu 16.0409/10/201809/10/2018
2017-GA-ubuntuamd64No DockerfileUbuntu 16.0409/10/201809/10/2018

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.

Docker Pull Command

docker pull mcr.microsoft.com/mssql/server