microsoft / mssql-docker Goto Github PK
View Code? Open in Web Editor NEWOfficial Microsoft repository for SQL Server in Docker resources
License: MIT License
Official Microsoft repository for SQL Server in Docker resources
License: MIT License
[from: @beaudryj] I wonder if it would be possible to refactor this in a way to have the script convert the yml down to JSON for people using docker compose.
ex:
services:
db:
image: microsoft/mssql-server-windows-express
environment:
sa_password: "Password1"
ACCEPT_EULA: "Y"
attach_dbs:
dbname: sampledb
dbfiles: '["C:\temp\sample.mdf","C:\temp\sample_log.ldf"]'
ports:
- "1433:1433" # REMARK: This is currently required, needs investigation
Is the above possible? Can the Linux version of sql server do replication or run agent jobs? If so how?
Trying to install the container from a Windows docker client causes an ERROR stating you must Accept the EULA. Presumably -e does not modify the environment variables on a Windows client.
This would allow for setting up the SQL Server instance using a randomly generated password for the SA login, creating the new login using the login name and password provided and then disabling the SA login.
Hey,
I am trying to restore a .bak
into a mssql-server
database in a Docker container, and I came across something weird while trying to get it working.
The documentation for setting up mssql-server
on Ubuntu often requires the user to restart mssql-server
with the following command (I am running this from a shell in my container and it's throwing an error):
$ systemctl restart mssql-server
Failed to connect to bus: No such file or directory
As far as I understand, you cannot run this command inside of a Docker container. The docs suggest using the systemctl
command to restart mssql-server
, but this cannot work, as systemctl
requires systemd
, which is not actually running in the image.
What should I do?
That way, the container will only be marked as healthy once the sa password set is complete.
Here's an example: https://github.com/aspnet/MusicStore/pull/749/files#diff-7ba4a03630a062fa2698551ad3cf2109R10
I can't get it to work though. Tracking issue on docker/docker: moby/moby#31366
The SQL Server on Windows container image has a startup script that will accept an JSON-formatted environment variable that represents a list of databases including data/log files to attach to the SQL Server instance on container run.
The script is currently based on PowerShell on SQL Server on Windows side: https://github.com/Microsoft/sql-server-samples/blob/master/samples/manage/windows-containers/mssql-server-2016-express-windows/start.ps1
For SQL Server on Linux container image we could wait for PowerShell SQLPS module to be available or use something like sqlcmd to attach the DBs.
This issue should be tracked along with the related issue to create a database on container run.
#2
Starting the container with mounted volume by
docker run -v //c/Users/makl/mssql-db:/var/opt/mssql -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=DatabaseUser123" -p 1433:1433 microsoft/mssql-server-linux
causes the server startup failure:
Configuring Microsoft(R) SQL Server(R)...
sqlservr: Debugger.cpp:578: static void Debugger::Print(const void *, unsigned int): Assertion `"A serious error condition has been encountered." == nullptr' failed.
cat: /proc/14/sched: No such file or directory
/opt/mssql/bin/generate-core.sh: line 135: lsof: command not found
cat: core.sqlservr.14.temp/log/debug.log: No such file or directory
No journal files were found.
No journal files were found.
ls: cannot access '/var/opt/mssql/log/errorlog*': No such file or directory
ls: cannot access '/var/opt/mssql/log/exception.log': No such file or directory
ls: cannot access '/var/opt/mssql/log/SQLDu*.txt': No such file or directory
ls: cannot access '/var/opt/mssql/log/SQLDu*.mdmp': No such file or directory
ls: cannot access '/var/opt/mssql/log/system_health*': No such file or directory
Configuration complete.
This is an evaluation version. There are [146] days left in the evaluation period.
sqlservr: Debugger.cpp:578: static void Debugger::Print(const void *, unsigned int): Assertion `"A serious error condition has been encountered." == nullptr' failed.
Capturing core dump and information for sqlservr (pid 127)...
cat: /proc/127/sched: No such file or directory
/opt/mssql/bin/generate-core.sh: line 135: lsof: command not found
Capturing dump with gdb
cat: core.sqlservr.127.temp/log/debug.log: No such file or directory
No journal files were found.
No journal files were found.
SQL Log Directory /var/opt/mssql/log
ls: cannot access '/var/opt/mssql/log/errorlog*': No such file or directory
ls: cannot access '/var/opt/mssql/log/exception.log': No such file or directory
ls: cannot access '/var/opt/mssql/log/SQLDu*.txt': No such file or directory
ls: cannot access '/var/opt/mssql/log/SQLDu*.mdmp': No such file or directory
ls: cannot access '/var/opt/mssql/log/system_health*': No such file or directory
Packaging core dump and information into compressed files.
Core dump and information will be written to /var/opt/mssql/log/core.sqlservr.03_21_2017_11_17_39.127 and logs in /var/opt/mssql/log/core.sqlservr.03_21_2017_11_17_39.127.log
The container should start successfully, eg. when no volume is used:
docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=DatabaseUser123" -p 1433:1433 microsoft/mssql-server-linux
Configuring Microsoft(R) SQL Server(R)...
Configuration complete.
This is an evaluation version. There are [146] days left in the evaluation period.
RegQueryValueEx HADR for key "Software\Microsoft\Microsoft SQL Server\MSSQL\MSSQLServer\HADR" failed.
2017-03-21 11:27:48.39 Server Microsoft SQL Server vNext (CTP1.3) - 14.0.304.138 (X64)
Feb 13 2017 16:49:12
Copyright (C) 2016 Microsoft Corporation. All rights reserved.
on Linux (Ubuntu 16.04.1 LTS)
2017-03-21 11:27:48.40 Server UTC adjustment: 0:00
2017-03-21 11:27:48.40 Server (c) Microsoft Corporation.
2017-03-21 11:27:48.40 Server All rights reserved.
2017-03-21 11:27:48.40 Server Server process ID is 4116.
2017-03-21 11:27:48.40 Server Logging SQL Server messages in file 'C:\var\opt\mssql\log\errorlog'.
2017-03-21 11:27:48.41 Server Registry startup parameters:
-d C:\var\opt\mssql\data\master.mdf
-l C:\var\opt\mssql\data\mastlog.ldf
-e C:\var\opt\mssql\log\errorlog
2017-03-21 11:27:48.43 Server SQL Server detected 1 sockets with 1 cores per socket and 1 logical processors per socket, 1 total logical processors; using 1 logical processors based on SQL Server licensing. This is an informational message; no user action is required.
2017-03-21 11:27:48.43 Server SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.
2017-03-21 11:27:48.44 Server Detected 3160 MB of RAM. This is an informational message; no user action is required.
2017-03-21 11:27:48.44 Server Using conventional memory in the memory manager.
Enabling HADR for this XCluster instance. May not work properly if prerequisites are not met.
2017-03-21 11:27:48.52 Server Default collation: SQL_Latin1_General_CP1_CI_AS (us_english 1033)
2017-03-21 11:27:48.64 Server Buffer pool extension is already disabled. No action is necessary.
2017-03-21 11:27:48.71 Server InitializeExternalUserGroupSid failed. Implied authentication will be disabled.
2017-03-21 11:27:48.71 Server Implied authentication manager initialization failed. Implied authentication will be disabled.
2017-03-21 11:27:48.75 Server The maximum number of dedicated administrator connections for this instance is '1'
2017-03-21 11:27:48.75 Server Node configuration: node 0: CPU mask: 0x0000000000000001:0 Active CPU mask: 0x0000000000000001:0. This message provides a description of the NUMA configuration for this computer. This is an informational message only. No user action is required.
2017-03-21 11:27:48.76 Server Using dynamic lock allocation. Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node. This is an informational message only. No user action is required.
2017-03-21 11:27:48.77 Server In-Memory OLTP initialized on lowend machine.
2017-03-21 11:27:48.82 Server Database Instant File Initialization: enabled. For security and performance considerations see the topic 'Database Instant File Initialization' in SQL Server Books Online. This is an informational message only. No user action is required.
2017-03-21 11:27:48.83 Server Query Store settings initialized with enabled = 1,
2017-03-21 11:27:48.84 spid6s Starting up database 'master'.
2017-03-21 11:27:48.85 Server Software Usage Metrics is disabled.
2017-03-21 11:27:49.04 spid6s 14 transactions rolled forward in database 'master' (1:0). This is an informational message only. No user action is required.
2017-03-21 11:27:49.04 spid6s 0 transactions rolled back in database 'master' (1:0). This is an informational message only. No user action is required.
2017-03-21 11:27:49.05 spid6s Recovery is writing a checkpoint in database 'master' (1). This is an informational message only. No user action is required.
2017-03-21 11:27:49.12 spid6s Buffer pool extension is already disabled. No action is necessary.
2017-03-21 11:27:49.12 spid6s Resource governor reconfiguration succeeded.
2017-03-21 11:27:49.12 spid6s SQL Server Audit is starting the audits. This is an informational message. No user action is required.
2017-03-21 11:27:49.13 spid6s SQL Server Audit has started the audits. This is an informational message. No user action is required.
2017-03-21 11:27:49.20 spid6s SQL Trace ID 1 was started by login "sa".
2017-03-21 11:27:49.21 spid6s Server name is 'fe5adcb2249c'. This is an informational message only. No user action is required.
2017-03-21 11:27:49.21 spid6s The NETBIOS name of the local node that is running the server is 'fe5adcb2249c'. This is an informational message only. No user action is required.
2017-03-21 11:27:49.24 spid17s Password policy update was successful.
2017-03-21 11:27:49.25 spid20s Always On: The availability replica manager is starting. This is an informational message only. No user action is required.
2017-03-21 11:27:49.25 spid20s Always On: The availability replica manager is waiting for the instance of SQL Server to allow client connections. This is an informational message only. No user action is required.
2017-03-21 11:27:49.25 spid7s Starting up database 'mssqlsystemresource'.
2017-03-21 11:27:49.26 spid6s Starting up database 'msdb'.
2017-03-21 11:27:49.27 spid7s The resource database build version is 14.00.304. This is an informational message only. No user action is required.
2017-03-21 11:27:49.35 spid7s Starting up database 'model'.
2017-03-21 11:27:49.64 spid6s 4 transactions rolled forward in database 'msdb' (4:0). This is an informational message only. No user action is required.
2017-03-21 11:27:49.68 spid6s 0 transactions rolled back in database 'msdb' (4:0). This is an informational message only. No user action is required.
2017-03-21 11:27:49.70 spid6s Recovery is writing a checkpoint in database 'msdb' (4). This is an informational message only. No user action is required.
2017-03-21 11:27:49.75 spid7s Polybase feature disabled.
2017-03-21 11:27:49.76 spid7s Clearing tempdb database.
2017-03-21 11:27:50.02 spid17s A self-generated certificate was successfully loaded for encryption.
2017-03-21 11:27:50.03 spid17s Server is listening on [ 0.0.0.0 <ipv4> 1433].
2017-03-21 11:27:50.04 Server Server is listening on [ 127.0.0.1 <ipv4> 1434].
2017-03-21 11:27:50.04 Server Dedicated admin connection support was established for listening locally on port 1434.
2017-03-21 11:27:50.05 spid17s SQL Server is now ready for client connections. This is an informational message; no user action is required.
2017-03-21 11:27:50.35 spid7s Starting up database 'tempdb'.
2017-03-21 11:27:50.59 spid7s The tempdb database has 1 data file(s).
2017-03-21 11:27:50.59 spid20s The Service Broker endpoint is in disabled or stopped state.
2017-03-21 11:27:50.60 spid20s The Database Mirroring endpoint is in disabled or stopped state.
2017-03-21 11:27:50.63 spid20s Service Broker manager has started.
2017-03-21 11:27:50.68 spid6s Recovery is complete. This is an informational message only. No user action is required.
C:\Users\makl>systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
OS Name: Microsoft Windows 10 Enterprise
OS Version: 10.0.10586 N/A Build 10586
$ docker -v
Docker version 17.03.0-ce, build 60ccb22
$ docker-machine -v
docker-machine.exe version 0.10.0, build 76ed2a6
$ vboxmanage -v
5.1.14r112924
This way the data can survive container re-creation cycles. This is best practice for DBMS as you can see in these examples:
https://github.com/arangodb/arangodb-docker/blob/official/Dockerfile.local#L32
Also it serves documentary purposes because people see which dirs actually contain movement data.
HI,
I'm having issues running a dockerized mssql-linux in a mac os using boot2docker.
I've restored an image of database.
But under extensive load the following exceptions start to appear:
NFO | jvm 1 | main | 2017/03/14 10:36:40.769 | Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed. INFO | jvm 1 | main | 2017/03/14 10:36:40.769 | at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:191) INFO | jvm 1 | main | 2017/03/14 10:36:40.769 | at com.microsoft.sqlserver.jdbc.SQLServerConnection.checkClosed(SQLServerConnection.java:710) INFO | jvm 1 | main | 2017/03/14 10:36:40.769 | at com.microsoft.sqlserver.jdbc.SQLServerConnection.prepareStatement(SQLServerConnection.java:2953) INFO | jvm 1 | main | 2017/03/14 10:36:40.769 | at com.microsoft.sqlserver.jdbc.SQLServerConnection.prepareStatement(SQLServerConnection.java:2592)
It looks to me that the connections are prematurely closed.
I have tried the following to make deal with the issue:
What else an I do to find the root cause? Are there any limitations in the "developer" edition that would result in connections being closed?
This probably requires that odbc tools be added to the image. However, both the official postgres and mysql images will execute any sql scripts in that folder. This makes it very easy to spin up an instance with, your schema already defined. Its also really good if you want to add some scripts like sp_WhoIsActive, Ola's maintenance script., or Brent's scripts to docker images.
Python isn't installed by default, so running the mssql-conf configuration tool isn't supported out of the box.
Please expose port 1433 in the docker file and change formatting of this image to allow proper docker API calls. Thank you.
Hi!
I'm wondering, is some version of FILESTREAM supported by the linux images?
Thanks!
I'm unable to pull microsoft/mssql-server-windows-express:latest
:
PS C:\Windows\system32> docker pull microsoft/mssql-server-windows-express:latest
latest: Pulling from microsoft/mssql-server-windows-express
9c7f9c7d9bc2: Downloading
d33fff6043a1: Downloading
af3d7434ed32: Download complete
968565c8428a: Download complete
17b0a00f8493: Download complete
f346dd23dc9c: Download complete
2036ad6741db: Download complete
98032b4c4f43: Download complete
2ec21bc5cf04: Download complete
50fa71ab72d1: Download complete
b234afb12f9d: Download complete
50760e4fd855: Download complete
beb921150b11: Download complete
3904339695eb: Download complete
a8c88f0d15fd: Download complete
unknown blob
I'm using Docker version 1.12.5, build 7392c3b on Windows 10.
I am new in docker.
I just wondering how can I attach/restore a mdf file or a bak file using a ubuntu terminal for mssql server?
thanks.
This goes for microsoft/mssql-server-linux
.
Can you explain why there two directories:
/opt/mssql/data
: This one is exposed as volume, so we can share data between host and container./var/opt/mssql/data
: This one actually holds database data *.mdf & .1df files.Then how can I create persistent data container?
Lets say I'm running brand new container, no custom database yet. Then my .NET application connect to SQL Server running in container, Entity Framework will push all migrations and create database. Now we get two new files in /var/opt/mssql/data
, <DBName>.mdf
and <DBName>.ldf
. Because new database isn't created in /opt/mssql/data
database is lost if container is stopped.
Shouldn't /var/opt/mssql/data
be exposed as volume?
Is storing database in *.mdf
file good practice for production use?
Upon executing docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=<YourStrong!Passw0rd>' -p 1433:1433 microsoft/mssql-server-linux
, I encounter the following message:
Configuring Microsoft(R) SQL Server(R)...
Microsoft(R) SQL Server(R) setup failed with error code 1. Please check the setup log in /var/opt/mssql/log for more information.
The setup log contains:
This is an evaluation version. There are [154] days left in the evaluation period.
2017-01-10 23:55:24.82 Server Setup step is copying system data file 'C:\templatedata\master.mdf' to 'C:\var\opt\mssql\data\master.mdf'.
2017-01-10 23:55:24.90 Server Setup step is copying system data file 'C:\templatedata\mastlog.ldf' to 'C:\var\opt\mssql\data\mastlog.ldf'.
2017-01-10 23:55:24.91 Server Setup step is copying system data file 'C:\templatedata\model.mdf' to 'C:\var\opt\mssql\data\model.mdf'.
2017-01-10 23:55:24.92 Server Setup step is copying system data file 'C:\templatedata\modellog.ldf' to 'C:\var\opt\mssql\data\modellog.ldf'.
2017-01-10 23:55:24.94 Server Setup step is copying system data file 'C:\templatedata\msdbdata.mdf' to 'C:\var\opt\mssql\data\msdbdata.mdf'.
2017-01-10 23:55:24.95 Server Setup step is copying system data file 'C:\templatedata\msdblog.ldf' to 'C:\var\opt\mssql\data\msdblog.ldf'.
2017-01-10 23:55:25.02 Server Microsoft SQL Server vNext (CTP1.1) - 14.0.100.187 (X64)
Dec 10 2016 02:51:11
Copyright (C) 2016 Microsoft Corporation. All rights reserved.
on Linux (Ubuntu 16.04.1 LTS)
2017-01-10 23:55:25.02 Server UTC adjustment: 0:00
2017-01-10 23:55:25.02 Server (c) Microsoft Corporation.
2017-01-10 23:55:25.03 Server All rights reserved.
2017-01-10 23:55:25.03 Server Server process ID is 4116.
2017-01-10 23:55:25.03 Server Logging SQL Server messages in file 'C:\var\opt\mssql\log\errorlog'.
2017-01-10 23:55:25.03 Server Registry startup parameters:
-d C:\var\opt\mssql\data\master.mdf
-l C:\var\opt\mssql\data\mastlog.ldf
-e C:\var\opt\mssql\log\errorlog
2017-01-10 23:55:25.03 Server Command Line Startup Parameters:
--setup
--sa-password
2017-01-10 23:55:25.04 Server Error: 17113, Severity: 16, State: 1.
2017-01-10 23:55:25.04 Server Error 87(The parameter is incorrect.) occurred while opening file 'C:\var\opt\mssql\data\master.mdf' to obtain configuration information at startup. An invalid startup option might have caused the error. Verify your startup options, and correct or remove them if necessary.
2017-01-10 23:55:25.05 Server SQL Server shutdown has been initiated
The /var/opt/mssql/data
directory contains:
-rw-r----- 1 root root 4194304 Jan 11 10:55 master.mdf
-rw-r----- 1 root root 524288 Jan 11 10:55 mastlog.ldf
-rw-r----- 1 root root 8388608 Jan 11 10:55 modellog.ldf
-rw-r----- 1 root root 8388608 Jan 11 10:55 model.mdf
-rw-r----- 1 root root 13959168 Jan 11 10:55 msdbdata.mdf
-rw-r----- 1 root root 524288 Jan 11 10:55 msdblog.ldf
Please advise.
What is the recommended approach to ensuring a graceful termination of the SQL service on container termination? Correct me if I'm wrong, but my understanding is that this is blocked on Windows container images until Windows containers receive notifications that come in docker 1.14.0. But such a thing should be possible for the Linux image?
So I have a few issues with the attach_dbs when using it with docker-compose, I attempted building off of the example json which fails as invalid JSON so I cleaned it up.
[
{
"dbName":"MaxDb",
"dbFiles":[
"C:\\temp\\maxtest.mdf",
"C:\\temp\\maxtest_log.ldf"
]
},
{
"dbName":"PerryDb",
"dbFiles":[
"C:\\temp\\perrytest.mdf",
"C:\\temp\\perrytest_log.ldf"
]
}
]
Am I supposed to have this configured differently ?
Is Full-Text Search supported or installed in linux docker container? Will be?
MSSQL Server
State: 42000
Code: 7609
Message: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]
Full-Text Search is not installed, or a full-text component cannot be loaded.
Request that linux and windows based images be updated to allow encryption of the connection. Ideally this would allow us to provide PEM files (or whatever format required) as a input which then would get loaded. This would help address the challenge of ensuring developers know how to make sure their application can utilize encryption which is a common challenge in many organizations.
i've start the instance by run the following command
docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=mystrongpassword' -p 1433:1433 -d microsoft/mssql-server-linux
but after several attempt to connect it keept throw error
Password: Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server : Login failed for user 'sa'..
checked the log in kinematic
Error: 18456, Severity: 14, State: 7.
2017-01-13 14:09:30.60 Logon Login failed for user 'sa'. Reason: An error occurred while evaluating the password. [CLIENT: 192.168.99.1]
i try to connect using this command
sqlcmd -S 192.168.99.100 -U sa -P 'mystrongpassword'
any help?
Since I updated my docker to Docker Community Edition, the microsoft/mssql-server-linux image will not start. I've tried removing all my images and repulling, but no dice. I'll do a
$ (sudo) docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=somelegitpasswordthatworked before' -p 1433:1433 -d microsoft/mssql-server-linux
It returns an ID, but when you immediately run "docker ps", there are no running images and you (obviously) can't connect to it.
My docker version (I'm on a Mac, btw):
Version 17.03.0-ce-mac2 (15657)
Channel: beta
32de842512
Thanks,
Seth
With mssql-server-linux I have a problem:
when I'm trying to start container, which was created like this one:
docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=%PASS%' -p 1433:1433 -d microsoft/mssql-server-linux
when I'm tring to start it, it generate an error:
Loading the directory /var/opt/mssql/.system/.system/telemetry failed
I have no idea what to do, could you please help me?
Use ServiceMonitor utility to replace the code
Write-Verbose "Started SQL Server."
while ($true) { Start-Sleep -Seconds 3600 }
to this:
ENTRYPOINT ["C:\\ServiceMonitor.exe", "MSSQL$SQLEXPRESS"]
Example:
https://github.com/Microsoft/iis-docker/blob/master/windowsservercore/Dockerfile
Don't use CMD statement, use RUN instead. It'll allow to execute custom scripts after SQL Server start (to create DB, for example).
At the moment, the data mapped to /var/opt/mssql is written as root only with root read/write access.
It would be great if we could configure a UID for the container to use when performing is fs operations. This way, we can better automate the deployment and tear down of stacks.
This especially useful during CI when we need to automate the testing DB migration and end to end tests.
A few weeks ago, the need for a pre-built PHP Docker image that included drivers and the PHP environment was raised in the following issues microsoft/msphpsql#168, #4 (comment).
For this purpose, we have created a Docker image for PHP and pdo_sqlsrv: https://github.com/Microsoft/mssql-docker/tree/master/developer-resources/php-mssql
This can also be pulled from lbosqmsft/php-mssql
.
Would these simplify developing with OSS frameworks? What other languages would be important to cover?
README.md for mssql-server-linux
states:
Current Limitations: Mapping volumes is not supported for Docker for Mac.
Could this limitation be resolved?
One example error from running mssql-con set-collation:
"Failed to connect to bus: No such file or directory
Sudo: unknown user: mssql
Sudo: unable to initialize policy plugin
An error occurred changing the collation. Check the error logs at /var/opt/mssql/log/
The server will be restarted with the previous collation value.
Failed to connect to bus: No such file or directory "
Starting the mssql-server-windows container gives the following error in the logs:
VERBOSE: Starting SQL Server
VERBOSE: Changing SA login credentials
Invoke-Sqlcmd : The 'Invoke-Sqlcmd' command was found in the module 'SQLPS', but the module could not be loaded. For more information, run 'Import-Module SQLPS'.
At C:\start.ps1:31 char:5
+ Invoke-Sqlcmd -Query $sqlcmd
+ ~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Invoke-Sqlcmd:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CouldNotAutoloadMatchingModule
VERBOSE: Started SQL Server.
by that the sa password is unchnged and the sql server is unusable
MySQL and Postgres provide passing the default port as a parameter.
This feature in presto requires passing port as a parameter
Teradata/presto#481 (review)
From the comments section in DockerHub: https://hub.docker.com/r/microsoft/mssql-server-linux/
Create a customer user admin login with environment variables for added security.
Is there a way to create a docker image for SQL Server 2012 Standard/Enterprise?
What are the host requirements for running SQL Server on Docker and how may I apply license and what license should I buy?
docker pull microsoft/mssql-server-linux
Using default tag: latest
latest: Pulling from microsoft/mssql-server-linux
aed15891ba52: Already exists
773ae8583d14: Extracting [==================================================>] 823 B/823 B
d1d48771f782: Download complete
cd3d6cd6c0cf: Download complete
8ff6f8a9120c: Download complete
1fd7e8b10447: Download complete
bd485157db89: Download complete
273a1970ce9c: Download complete
d2d0b4dc209f: Download complete
failed to register layer: open /home/docker/aufs/layers/979db2360ccddf7f589f2478dc9eefcb6a7dad27fed64767aeeb5b09daa9c270: no such file or directory
docker --version
Docker version 1.12.5, build 7392c3b
uname -a
Linux DESKTOP-TSOA72N 3.13.0-106-generic #153-Ubuntu SMP Tue Dec 6 15:44:32 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
You can see that the second layer never finishes extracting.
I bas on Mac
.
1- Run docker run --name mssql-container -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=123456' -p 1433:1433 -d microsoft/mssql-server-linux
.
It show
Microsoft(R) SQL Server(R) setup failed with error code 1. Please check the setup log in /var/opt/mssql/log for more information.
2- And then I stop and start again, I work
~ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
43db0fce3c75 microsoft/mssql-server-linux "/bin/sh -c /opt/mssq" 3 minutes ago Up 2 minutes
3- Connect with
~ mssql -s localhost -u sa -p 123456 -o 1433
Connecting to localhost...
Error: Login failed for user 'sa'.
Please help me.
When the SA_PASSWORD does not pass the password complexity checks, the container will fail to start.
Example:
$ docker run -e ACCEPT_EULA=Y -e SA_PASSWORD=abc -p 1433:1433 -it microsoft/mssql-server-linux
Configuring Microsoft(R) SQL Server(R)...
Microsoft(R) SQL Server(R) setup failed with error code 1. Please check the setup log in /var/opt/mssql/log for more information.
It takes a big of digging to figure out how to start the bash shell via docker exec
in order to actually see what is in /var/opt/mssql/log/setup*.log
. It would be nice to show the error on in docker's default output.
2017-03-11 00:47:10.07 spid17s Password validation failed. The password does not meet SQL Server password policy requirements because it is not complex enough. The p
assword must be at least 8 characters long and contain characters from three of the following five sets: Uppercase letters, Lowercase letters, Base 10 digits, Non-Alphan
umeric characters, or unicode characters that are categorized as alphabetic characters, but are not uppercase or lowercase.
2017-03-11 00:47:10.07 spid17s An error occurred while setting the server administrator (SA) password: error 33064, severity 16, state 2.
For scenarios where you might want to create logins, run some test/initial data population script, etc. it would be nice to be able to point to a sql script file and have that be executed by the entrypoint script after the sqlservr process is started.
on windows sqlserver, we need to copy some .DLL and run sql commands to add extra stored procedures.
how does it work with linux docker image ?
thanks
Hello team,
I'd like to know is it free to use the mssql docker on linux? As I know MSSQL is very expensive on windows.
Thank you.
after upgrading docker from 1.12 to 1.13 and sqlserver image for linux from 14.0.1.246 (X64)
to 14.0.100.187 (X64)
container log shows below error but the file names reported to contain relevant informant have size of 0 byte for '/var/opt/mssql/log/core.sqlservr.01_20_2017_17_27_03.11.log' and the core dump does not exist ' /var/opt/mssql/log/core.sqlservr.01_20_2017_17_27_03.11'
docker version:
Server:
Version: 1.13.0
API version: 1.25 (minimum version 1.12)
Go version: go1.7.3
Git commit: 49bf474
Built: Wed Jan 18 16:20:26 2017
OS/Arch: linux/amd64
Experimental: false
This is an evaluation version. There are [144] days left in the evaluation period.
2017-01-20 17:20:34.71 Server Microsoft SQL Server vNext (CTP1.1) - 14.0.100.187 (X64)
Dec 10 2016 02:51:11
Copyright (C) 2016 Microsoft Corporation. All rights reserved.
on Linux (Ubuntu 16.04.1 LTS)
2017-01-20 17:20:34.72 Server UTC adjustment: 0:00
2017-01-20 17:20:34.72 Server (c) Microsoft Corporation.
2017-01-20 17:20:34.72 Server All rights reserved.
2017-01-20 17:20:34.72 Server Server process ID is 4116.
2017-01-20 17:20:34.72 Server Logging SQL Server messages in file 'C:\var\opt\mssql\log\errorlog'.
2017-01-20 17:20:34.72 Server Registry startup parameters:
-d C:\var\opt\mssql\data\master.mdf
-l C:\var\opt\mssql\data\mastlog.ldf
-e C:\var\opt\mssql\log\errorlog
2017-01-20 17:20:35.07 Server SQL Server detected 1 sockets with 2 cores per socket and 2 logical processors per socket, 2 total logical processors; using 2 logical processors based on SQL Server licensing. This is an informational message; no user action is required.
2017-01-20 17:20:35.07 Server SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.
2017-01-20 17:20:35.08 Server Detected 3541 MB of RAM. This is an informational message; no user action is required.
2017-01-20 17:20:35.08 Server Using conventional memory in the memory manager.
2017-01-20 17:20:36.74 Server Default collation: SQL_Latin1_General_CP1_CI_AS (us_english 1033)
2017-01-20 17:20:41.45 Server Buffer pool extension is already disabled. No action is necessary.
2017-01-20 17:20:47.89 Server InitializeExternalUserGroupSid failed. Implied authentication will be disabled.
2017-01-20 17:20:47.89 Server Implied authentication manager initialization failed. Implied authentication will be disabled.
2017-01-20 17:20:48.64 Server The maximum number of dedicated administrator connections for this instance is '1'
2017-01-20 17:20:48.65 Server Node configuration: node 0: CPU mask: 0x0000000000000003:0 Active CPU mask: 0x0000000000000003:0. This message provides a description of the NUMA configuration for this computer. This is an informational message only. No user action is required.
2017-01-20 17:20:48.68 Server Using dynamic lock allocation. Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node. This is an informational message only. No user action is required.
2017-01-20 17:20:48.68 Server Database Instant File Initialization: enabled. For security and performance considerations see the topic 'Database Instant File Initialization' in SQL Server Books Online. This is an informational message only. No user action is required.
2017-01-20 17:20:48.69 Server Query Store settings initialized with enabled = 1,
2017-01-20 17:20:48.72 spid4s Starting up database 'master'.
2017-01-20 17:20:48.73 Server In-Memory OLTP initialized on lowend machine.
2017-01-20 17:20:50.86 Server Software Usage Metrics is disabled.
2017-01-20 17:20:52.93 spid4s 4 transactions rolled forward in database 'master' (1:0). This is an informational message only. No user action is required.
2017-01-20 17:20:53.20 spid4s 0 transactions rolled back in database 'master' (1:0). This is an informational message only. No user action is required.
2017-01-20 17:20:53.21 spid4s Recovery is writing a checkpoint in database 'master' (1). This is an informational message only. No user action is required.
2017-01-20 17:20:54.23 spid4s Buffer pool extension is already disabled. No action is necessary.
2017-01-20 17:20:54.23 spid4s Resource governor reconfiguration succeeded.
2017-01-20 17:20:54.23 spid4s SQL Server Audit is starting the audits. This is an informational message. No user action is required.
2017-01-20 17:20:54.25 spid4s SQL Server Audit has started the audits. This is an informational message. No user action is required.
2017-01-20 17:20:56.19 spid4s SQL Trace ID 1 was started by login "sa".
2017-01-20 17:20:56.24 spid4s Server name is '6efa3aef6ecf'. This is an informational message only. No user action is required.
2017-01-20 17:20:56.28 spid20s Starting up database 'msdb'.
2017-01-20 17:20:56.28 spid6s Starting up database 'mssqlsystemresource'.
2017-01-20 17:20:56.29 spid21s Starting up database 'testdb'.
2017-01-20 17:20:56.32 spid6s The resource database build version is 14.00.100. This is an informational message only. No user action is required.
2017-01-20 17:20:56.41 spid6s Starting up database 'model'.
2017-01-20 17:21:02.80 spid21s Parallel redo is started for database 'testdb' with worker pool size [1].
2017-01-20 17:21:03.53 spid6s Polybase feature disabled.
2017-01-20 17:21:03.53 spid6s Clearing tempdb database.
2017-01-20 17:21:03.90 spid4s Recovery completed for database msdb (database ID 4) in 2 second(s) (analysis 27 ms, redo 740 ms, undo 480 ms.) This is an informational message only. No user action is required.
2017-01-20 17:21:04.59 spid21s 66 transactions rolled forward in database 'testdb' (5:0). This is an informational message only. No user action is required.
2017-01-20 17:21:04.77 spid4s 0 transactions rolled back in database 'testdb' (5:0). This is an informational message only. No user action is required.
2017-01-20 17:21:04.78 spid4s Recovery completed for database testdb (database ID 5) in 3 second(s) (analysis 87 ms, redo 1705 ms, undo 123 ms.) This is an informational message only. No user action is required.
2017-01-20 17:21:04.80 spid4s Parallel redo is shutdown for database 'testdb' with worker pool size [1].
2017-01-20 17:21:15.64 spid17s A self-generated certificate was successfully loaded for encryption.
2017-01-20 17:21:16.11 spid17s Server is listening on [ 0.0.0.0 1433].
2017-01-20 17:21:16.12 Server Server is listening on [ 127.0.0.1 1434].
2017-01-20 17:21:16.12 Server Dedicated admin connection support was established for listening locally on port 1434.
2017-01-20 17:21:16.13 spid17s SQL Server is now ready for client connections. This is an informational message; no user action is required.
2017-01-20 17:21:18.32 spid6s Starting up database 'tempdb'.
2017-01-20 17:21:21.61 spid6s The tempdb database has 1 data file(s).
2017-01-20 17:21:21.82 spid22s The Service Broker endpoint is in disabled or stopped state.
2017-01-20 17:21:21.82 spid22s The Database Mirroring endpoint is in disabled or stopped state.
DBSTARTUP (testdb, 5): FCBOpenTime took 2390 ms
DBSTARTUP (testdb, 5): FCBHeaderReadTime took 1512 ms
DBSTARTUP (testdb, 5): FileMgrPreRecoveryTime took 3125 ms
DBSTARTUP (testdb, 5): MasterFilesScanTime took 1029 ms
DBSTARTUP (testdb, 5): AnalysisRecTime took 231 ms
DBSTARTUP (testdb, 5): RedoRecTime took 1705 ms
DBSTARTUP (testdb, 5): PhysicalRecoveryTime took 1941 ms
DBSTARTUP (testdb, 5): StartupInDatabaseTime took 17068 ms
2017-01-20 17:21:22.03 spid22s Service Broker manager has started.
DBSTARTUP (msdb, 4): FCBOpenTime took 2340 ms
DBSTARTUP (msdb, 4): FCBHeaderReadTime took 1436 ms
DBSTARTUP (msdb, 4): FileMgrPreRecoveryTime took 2996 ms
DBSTARTUP (msdb, 4): MasterFilesScanTime took 960 ms
DBSTARTUP (msdb, 4): RedoRecTime took 740 ms
DBSTARTUP (msdb, 4): PhysicalRecoveryTime took 768 ms
DBSTARTUP (msdb, 4): RecoveryCompletionTime took 281 ms
DBSTARTUP (msdb, 4): StartupInDatabaseTime took 17741 ms
2017-01-20 17:21:22.45 spid4s Recovery is complete. This is an informational message only. No user action is required.
2017-01-20 17:25:50.40 spid51 Attempting to load library 'xplog70.dll' into memory. This is an informational message only. No user action is required.
2017-01-20 17:25:52.47 spid51 Using 'xplog70.dll' version '2016.140.100' to execute extended stored procedure 'xp_msver'. This is an informational message only; no user action is required.
sqlservr: ObjectWaitContext.cpp:533: void ObjectWaitContext::Wait(const PLONG64): Assertion `m_state == State::Signaled' failed.
Capturing core dump and information for sqlservr (pid 11)...
cat: core.sqlservr.11.temp/log/debug.log: No such file or directory
dmesg: read kernel buffer failed: Operation not permitted
No journal files were found.
No journal files were found.
ls: cannot access '/var/opt/mssql/log/log/errorlog*': No such file or directory
ls: cannot access '/var/opt/mssql/log/log/exception.log': No such file or directory
ls: cannot access '/var/opt/mssql/log/log/SQLDu*.txt': No such file or directory
ls: cannot access '/var/opt/mssql/log/log/SQLDu*.mdmp': No such file or directory
ls: cannot access '/var/opt/mssql/log/log/system_health*': No such file or directory
Packaging core dump and information into compressed files.
Core dump and information will be written to /var/opt/mssql/log/core.sqlservr.01_20_2017_17_27_03.11 and logs in /var/opt/mssql/log/core.sqlservr.01_20_2017_17_27_03.11.log
Hello I am trying to create a huge amount of data (with a nodejs aplication launching scripts against the SQL Server dockerized).
But almost every time, after a while, I got this error. Do you have any idea about what the problem can be? Do you need something more?
sqlservr: ObjectWaitContext.cpp:533: void ObjectWaitContext::Wait(const PLONG64): Assertion `m_state == State::Signaled' failed.
Capturing core dump and information for sqlservr (pid 124)...
cat: core.sqlservr.124.temp/log/debug.log: No such file or directory
dmesg: read kernel buffer failed: Operation not permitted
No journal files were found.
No journal files were found.
ls: cannot access '/var/opt/mssql/log/log/errorlog*': No such file or directory
ls: cannot access '/var/opt/mssql/log/log/exception.log': No such file or directory
ls: cannot access '/var/opt/mssql/log/log/SQLDu*.txt': No such file or directory
ls: cannot access '/var/opt/mssql/log/log/SQLDu*.mdmp': No such file or directory
ls: cannot access '/var/opt/mssql/log/log/system_health*': No such file or directory
Packaging core dump and information into compressed files.
Core dump and information will be written to /var/opt/mssql/log/core.sqlservr.01_18_2017_09_13_11.124 and logs in /var/opt/mssql/log/core.sqlservr.01_18_2017_09_13_11.124.log
Would it be possible to migrate to the Nano Server base image? At least for the Developer version: starting up the container takes a good minute or two on a pretty buffy machine, and then you'd need to wait for a minute or two while SQL Server starts accepting connections. Some of this time just accounts for the sheer size of the image, which is at least 5GB due to the size of the Server Core image.
Developers might need to re-run a container quite often, and it's getting annoying quite quickly :)
So we don't need to be on latest/master all the time.
A couple of comments (4) in the DockerHub page suggest adding parameters to create a database with username and password automatically.
This docker will not start for me. However, if I use
militellovinx/mssql-server-linux:latest
then it will run. Not sure why. I would prefer to use the latest release from MS.
root@localhost:#
/usr/local/emhttp/plugins/dynamix.docker.manager/scripts/docker run -d --name="KE-MSSQL" --net="bridge" -e TZ="America/New_York" -e HOST_OS="unRAID" -e "ACCEPT_EULA"="Y" -e "SA_PASSWORD"="password" -p 1433:1433/tcp -v "/var/dockers/ke/sql/":"/var/opt/mssql":rw -m 4GB microsoft/mssql-server-linux:latest
8619b44395377d22250742557e1f586ec4e2cbab6de91f716d7c194f96b53738The command finished successfully!
Configuring Microsoft(R) SQL Server(R)...
sqlservr: vm.cpp:38: BOOLEAN IsPossiblyValidPalAddress(const void *): Assertion `result' failed.
cat: /proc/22/sched: No such file or directory
No journal files were found.
No journal files were found.
ls: cannot access '/var/opt/mssql/log/errorlog*': No such file or directory
ls: cannot access '/var/opt/mssql/log/exception.log': No such file or directory
ls: cannot access '/var/opt/mssql/log/SQLDu*.txt': No such file or directory
ls: cannot access '/var/opt/mssql/log/SQLDu*.mdmp': No such file or directory
ls: cannot access '/var/opt/mssql/log/system_health*': No such file or directory
Configuration complete.
paltelemetry: Loading the directory /var/opt/mssql/.system/.system/telemetry failed. Errno [2]
This is an evaluation version. There are [174] days left in the evaluation period.
sqlservr: vm.cpp:38: BOOLEAN IsPossiblyValidPalAddress(const void *): Assertion `result' failed.
Capturing core dump and information for sqlservr (pid 151)...
cat: /proc/151/sched: No such file or directory
No journal files were found.
No journal files were found.
SQL Log Directory /var/opt/mssql/log
ls: cannot access '/var/opt/mssql/log/errorlog*': No such file or directory
ls: cannot access '/var/opt/mssql/log/exception.log': No such file or directory
ls: cannot access '/var/opt/mssql/log/SQLDu*.txt': No such file or directory
ls: cannot access '/var/opt/mssql/log/SQLDu*.mdmp': No such file or directory
ls: cannot access '/var/opt/mssql/log/system_health*': No such file or directory
Packaging core dump and information into compressed files.
Core dump and information will be written to /var/opt/mssql/log/core.sqlservr.01_24_2017_23_34_22.151 and logs in /var/opt/mssql/log/core.sqlservr.01_24_2017_23_34_22.151.log
There are multiple requests for having mssql-tools in the container to do data import and export and quick management of databases.
I think this is more the underlying windowsservercore container but I cannot see a github page for that. So posting here, sorry if incorrect. I am using an official Azure Server 2016 machine with Containers VM. Docker version 1.12.2-cs2-ws-beta and image microsoft/windowsservercore:4d83c32ad497. Trying to install IIS-NetFxExtensibility via DISM fails on Docker 1.14-dev too. This really prevents the images being useful. This image is the underlying images used for the SQL server images so it is affecting those also.
dism /online /enable-feature /featurename:IIS-NetFxExtensibility /All
Error: 0x800f081f The source files could not be found. Use the "Source" option to specify the location of the files that are required to restore the feature. For more information on specifying a source location, see http://go.microsoft.com/fwlink/?LinkId=243077.
I know it is not a problem with Windows 2016 as I can run this command from the Server 2016 docker host (not servercore admittedly but surely close enough) and it installs the feature as expected. Am I doing anything wrong?
Examples of things that should be documented as best practices:
Change the sa account password after docker run so that the actual password is not stored in the SA_PASSWORD env variable.
Use persistent storage for db data/log files and config ini file.
Use container volume for data persistence on macOS for now since mapped host volumes don't work.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.