This problem has been mentioned here several times. The SQL Server / Linux container is terminated because the SQL server shuts down unexpectedly shortly after it starts.
docker logs (docker for Windows) displays this SQL Server error:
2018-03-19 16:59:53.76 spid7s Error: 17053, Severity: 16, State: 1.
2018-03-19 16:59:53.76 spid7s /var/opt/mssql/data/mastlog.ldf: Operating system error 31(A device attached to the system is not functioning.) encountered
If I'm looking Google is full of this error message, why is there no solution?
I solve this by running this command in powershell:
docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=<YourStrong!Passw0rd>"
-p 1401:1433 --name sql1
-d microsoft/mssql-server-linux:2017-latest
source: https://docs.microsoft.com/en-us/sql/linux/quickstart-install-connect-docker
@wontra - what is the docker run command that you are using? Are you trying to mount a volume?
I have the same issue. Used command is:
docker run --name=mssql-server-linux -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=<YourStrong!Passw0rd>' -p 1433:1433 -d -v D:\docker-data\mssql\data:/var/opt/mssql/data -v D:\docker-data\mssql\backups:/var/backups microsoft/mssql-server-linux:latest
@govorovvs - Please try without -v and let us know if that works. Also - try without -d so you can see the output from the startup routine.
@twright-msft
I tried command
docker run --name=mssql-server-linux-2 -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=<YourStrong!Passw0rd>' -p 1433:1433 microsoft/mssql-server-linux:latest
and container started without any issues.
Yeah, I think there is a problem with container volume mounting on Windows right now. What version of Windows do you have?
@twright-msft - 10.0.16299.0
PS C:\WINDOWS\system32> docker info
Server Version: 18.03.0-ce
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: cfd04396dc68220d1cecbe686a6cc3aa5ce3667c
runc version: 4fc53a81fb7c994640722ac585fa9ca548971871
init version: 949e6fa
Security Options:
seccomp
Profile: default
Kernel Version: 4.9.87-linuxkit-aufs
Operating System: Docker for Windows
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 3.837GiB
Name: linuxkit-00155d0228a8
ID: G74J:3FK6:U4ED:TNV4:Y7JX:LZ57:6JHB:LYNZ:CIVK:M3DT:HJ7W:X53O
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
File Descriptors: 19
Goroutines: 36
System Time: 2018-04-02T06:22:31.9942368Z
Labels:
Experimental: true
starting container on statable version produces the same issue
Another detail that I have noticed is that the container just works when runs command on powershell but on cmd it doesn't.
hmm... interesting. couple of possibilities - quotes/special characters are handled differently. Elevated privileges.
@govorovvs - are you using cmd or PowerShell?
@twright-msft - I tried both PowerShell and cmd
I encountered a similar error when there is no space left in Docker container. Try doing "df -h" from docker image bash and check space to verify if that is the issue.
Mounting volumes from D: drive causes this issue
docker run --name=mssql-server-linux -d -v D:\data:/var/opt/mssql/data microsoft/mssql-server-linux
mounting volumes from C: drive - container starts without issues
docker run --name=mssql-server-linux -d -v C:\data:/var/opt/mssql/data microsoft/mssql-server-linux
@govorovvs - Make sure that you have shared your D:\ volume with your containers in the Docker settings (click on the whale icon in your system tray on the task bar).
@twright-msft D:\ is shared
Maybe try mounting other containers like postgres to D:\ and see if it is a mounting problem or something specific to mssql-server-linux.
After a long time, i found its because we set a weak password. Use a strong password matching the criteria as per microsoft documentation, it will never exit.

After a long time, i found its because we set a weak password. Use a strong password matching the criteria as per microsoft documentation, it will never exit.
thanks, it's work for me
After a long time, i found its because we set a weak password. Use a strong password matching the criteria as per microsoft documentation, it will never exit.
thanks mate, it's worked for me
Most helpful comment
I solve this by running this command in powershell:
docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=<YourStrong!Passw0rd>"-p 1401:1433 --name sql1
-d microsoft/mssql-server-linux:2017-latestsource: https://docs.microsoft.com/en-us/sql/linux/quickstart-install-connect-docker