Public Repository

Last pushed: 9 days ago
Short Description
Official images for Microsoft SQL Server on Linux for Docker Engine.
Full Description

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.

Additional Microsoft SQL Server Docker Images

Requirements


  • 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
    • ACCEPT_EULA=Y
    • SA_PASSWORD=<your_strong_password>
  • 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

There are no tools installed inside the container for now. You can connect to the SQL Server instance 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.

Environment Variables
  • ACCEPT_EULA confirms 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.

User Feedback


  • For issues with or questions about this image, please contact us through a GitHub issue.

Further Reading


Docker Pull Command
Owner
microsoft

Comments (82)
tribonieila
a day ago

Thank You! It Works!

sanjaysharma
9 days ago

I am this sqlserver image with docker-compose. I randomly get the below error.

java.lang.RuntimeException: java.sql.SQLException: Cannot create PoolableConnectionFactory (The TCP/IP connection to the host sqlserver, port 1433 has failed. Error: "Connection refused. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.".)

It fixes itself after couple of restarts, but bothers me as I have to re run my failed Travis job.
Has anyone experienced the same ?

joeltrancon
10 days ago

Please also add environment variables for creation of initial User + Password, so sa-user does not need to be used.

ante5273
10 days ago

@paigeadele try to use SqlConnectionStringBuilder. Initially i put my connectionstring on appsettings.json as usual. But i didn't work. https://www.microsoft.com/en-us/sql-server/developer-get-started/csharp-ubuntu

Here's my working code.
SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();
builder.DataSource = "db"; // update me
builder.UserID = "sa"; // update me
builder.Password = "Passw0rd"; // update me
builder.InitialCatalog = "testdb";
return builder.ConnectionString;

evgkib
11 days ago

I'm new to docker, so I don't know if I'm doing it right, but when I start the mssql-server-linux container with a mapped drive for config files and databases on windows, and then try to restore a database, it crashes. Is it just me?

paigeadele
18 days ago

#rip

paigeadele
18 days ago

not working

Cannot connect to 192.168.1.20.

===================================

Login failed for user 'sa'. (.Net SqlClient Data Provider)


For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=18456&LinkId=20476


Server Name: 192.168.1.20
Error Number: 18456
Severity: 14
State: 1
Line Number: 65536


Program Location:

at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken, Boolean applyTransientFaultHandling)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions) at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource1 retry)
at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
at System.Data.SqlClient.SqlConnection.Open()
at Microsoft.SqlServer.Management.SqlStudio.Explorer.ObjectExplorerService.ValidateConnection(UIConnectionInfo ci, IServerType server)
at Microsoft.SqlServer.Management.UI.ConnectionDlg.Connector.ConnectionThreadUser()

twrightmsft
25 days ago

@ante5273 - Glad to hear you got it working!

ante5273
a month ago

I managed to run mssql successfully using azure file.
I explained my test method and environment on the following link.
https://github.com/junpark12/LinuxSql/tree/master.
The only problem that i see at this moment, it takes 10-15 mins to go online after i started the mssql container.

ante5273
a month ago

@twrightmsft - When the container crashed, i collected the following error message using "docker log"
It seem that there were connection or access problem between docker container and azure file share. because i specified to load "/var/opt/mssql" directory from azure file share.

paltelemetry: Loading the directory /var/opt/mssql/.system/.system/telemetry failed. Errno [2]
This is an evaluation version. There are [170] days left in the evaluation period.
2017-01-28 04:43:31.04 Server Microsoft SQL Server vNext (CTP1.2) - 14.0.200.24 (X64)
Jan 10 2017 19:15:28
Copyright (C) 2016 Microsoft Corporation. All rights reserved.
on Linux (Ubuntu 16.04.1 LTS)
2017-01-28 04:43:31.04 Server UTC adjustment: 0:00
2017-01-28 04:43:31.04 Server (c) Microsoft Corporation.
2017-01-28 04:43:31.04 Server All rights reserved.
2017-01-28 04:43:31.05 Server Server process ID is 4116.
2017-01-28 04:43:31.05 Server Logging SQL Server messages in file 'C:\var\opt\mssql\log\errorlog'.
2017-01-28 04:43:31.05 Server Registry startup parameters: