mssql-docker
mssql-docker copied to clipboard
Can't run mssql on docker on MacOS 15.0.1 and Docker Desktop 4.34.2
Steps to recreate:
- Run the command
$ docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=admin" -p 1433:1433 -d mcr.microsoft.com/mssql/server:2017-latest
Environment Info
Device: Macbook Pro M3 Pro OS: Sequoia 15.0.1 Docker Desktop: 4.34.2 Docker version: Docker version 27.2.0, build 3ab4256
Logs
SQL Server 2017 will run as non-root by default.
This container is running as user root.
To learn more visit https://go.microsoft.com/fwlink/?linkid=2099216.
This program has encountered a fatal error and cannot continue running at Fri Oct 18 07:27:44 2024
The following diagnostic information is available:
Reason: 0x00000001
Signal: SIGABRT - Aborted (6)
Stack:
IP Function
---------------- --------------------------------------
000055555569eb0c <unknown>
000055555569e552 <unknown>
000055555569db61 <unknown>
00007ffffcd2af10 killpg+0x40
00007ffffcd2ae87 gsignal+0xc7
00007ffffcd2c7f1 abort+0x141
0000555555633762 <unknown>
00005555556b3314 <unknown>
00005555556e81f8 <unknown>
00005555556e7fda <unknown>
000055555563f5da <unknown>
000055555563f22f <unknown>
Process: 9 - sqlservr
Thread: 84 (application thread 0x144)
Instance Id: 67d6ceb2-e160-4e6f-acef-243eefb37d3d
Crash Id: 24b00197-99d7-4290-9084-71dc6dd02f32
Build stamp: 3ebe3286cc04b1ea22c1d74c18613ff585b82c7a72e511e2d06f6994326d96d2
Distribution: Ubuntu 18.04.6 LTS
Processors: 11
Total Memory: 8219394048 bytes
Timestamp: Fri Oct 18 07:27:44 2024
Last errno: 2
Last errno text: No such file or directory
Capturing a dump of 9
FAILED to capture a dump. Details in paldumper log.
Executing: /opt/mssql/bin/handle-crash.sh with parameters
handle-crash.sh
/opt/mssql/bin/sqlservr
9
/opt/mssql/bin
/var/opt/mssql/log/
67d6ceb2-e160-4e6f-acef-243eefb37d3d
24b00197-99d7-4290-9084-71dc6dd02f32
Ubuntu 18.04.6 LTS
Capturing core dump and information to /var/opt/mssql/log...
dmesg: read kernel buffer failed: Operation not permitted
/usr/bin/timeout: failed to run command '/bin/journalctl': No such file or directory
/usr/bin/timeout: failed to run command '/bin/journalctl': No such file or directory
Fri Oct 18 07:29:57 UTC 2024 Capturing program information
Fri Oct 18 07:29:58 UTC 2024 Attempting to capture a dump with paldumper for pid 9
WARNING: Capture attempt failure detected
Attempting to capture a filtered dump with paldumper for pid 9
WARNING: Attempt to capture dump failed. Reference /var/opt/mssql/log/core.sqlservr.9.temp/log/paldumper-debug.log for details
Fri Oct 18 07:29:58 UTC 2024 Attempting to capture a dump with gdb
Fri Oct 18 07:29:58 UTC 2024 Captured a dump with gdb
Fri Oct 18 07:29:58 UTC 2024 Capturing program binaries
Fri Oct 18 07:30:00 UTC 2024 Not compressing the dump files, moving instead to: /var/opt/mssql/log/core.sqlservr.10_18_2024_07_27_44.9.d
The problem shouldn't be macOS or Docker Desktop - your MSSQL_SA_PASSWORD needs to be more safe as stated in the docs:
Your password should follow the SQL Server default password policy, otherwise the container can't set up SQL Server, and stops working. By default, the password must be at least eight characters long and contain characters from three of the following four sets: uppercase letters, lowercase letters, base-10 digits, and symbols.
That's why they always use <YourStrong@Passw0rd> in examples.
This is likely related to https://github.com/docker/for-mac/issues/7368 - looks like a silicon emulation bug to me, manifesting on docker desktop since 4.33. I have a sinking feeling this will sit in limbo between the two repos as it's been an issue for 4 minor versions now...
I ended up here after the malware popup issue going around, finally got docker desktop up and working again, now the MSSQL 2022 container just starts and stops... such a bummer right now
I ended up here after the malware popup issue going around, finally got docker desktop up and working again, now the MSSQL 2022 container just starts and stops... such a bummer right now
Same here
I'm back in business
Docker App 4.34.2 Latest sql server image from a pull
So the current container still stopped...
I tested making a new container against that image, and that worked perfectly fine (default, no mount)... so I deleted it and re-added pointed at my current containers mount, and it all just works again. Deleted the one that kept stopping.
docker run -e 'ACCEPT_EULA=Y' -e 'MSSQL_SA_PASSWORD=xxxxx' -p 1433:1433 -v /Users/steve/SQL/data:/var/opt/mssql/data -v /Users/steve/SQL/log:/var/opt/mssql/log -v /Users/steve/SQL/secrets:/var/opt/mssql/secrets -d mcr.microsoft.com/mssql/server:2022-latest
I'm back in business
Docker App 4.34.2 Latest sql server image from a pull
So the current container still stopped...
I tested making a new container against that image, and that worked perfectly fine (default, no mount)... so I deleted it and re-added pointed at my current containers mount, and it all just works again. Deleted the one that kept stopping.
docker run -e 'ACCEPT_EULA=Y' -e 'MSSQL_SA_PASSWORD=xxxxx' -p 1433:1433 -v /Users/steve/SQL/data:/var/opt/mssql/data -v /Users/steve/SQL/log:/var/opt/mssql/log -v /Users/steve/SQL/secrets:/var/opt/mssql/secrets -d mcr.microsoft.com/mssql/server:2022-latest
The key here is you have to upgrade to 2022 from 2017. Here is the command I used since I only need it locally for development
docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=YourStrong@Passw0rd" --name mssql-db -p 1433:1433 -v sqlvolume:/var/opt/mssql -d mcr.microsoft.com/mssql/server:2022-latest