SQL server on M1 based Mac using Docker [closed]

I am trying to install SQL Server on m1 based Mac with docker

https://debugsolutions.wordpress.com/2021/03/17/using-sql-server-on-m1-based-mac-with-docker/

I made it all the way to end of step 5, but my container won't connect. I am getting:

1/08/02 01:31:47 [launchpadd] INFO: Launchpadd is connecting to mssql on localhost:1431
2021/08/02 01:31:47 [launchpadd] WARNING: Failed to connect to SQL because: dial tcp 127.0.0.1:1431: connect: connection refused, will reattempt connection.
2021/08/02 01:31:48 [launchpadd] WARNING: Failed to connect to SQL because: dial tcp 127.0.0.1:1431: connect: connection refused, will reattempt connection.
2021/08/02 01:31:49 [launchpadd] WARNING: Failed to connect to SQL because: dial tcp 127.0.0.1:1431: connect: connection refused, will reattempt connection.
2021/08/02 01:32:41 [launchpadd] INFO: Extensibility Log Header:
2021/08/02 01:32:41 [launchpadd] WARNING: Failed to load /var/opt/mssql/mssql.conf ini file with error open /var/opt/mssql/mssql.conf: no such file or directory
2021/08/02 01:32:41 [launchpadd] INFO: DataDirectories = /bin:/etc:/lib:/lib32:/lib64:/sbin:/usr/bin:/usr/include:/usr/lib:/usr/lib32:/usr/lib64:/usr/libexec/gcc:/usr/sbin:/usr/share:/var/lib:/opt/microsoft:/opt/mssql-extensibility:/opt/mssql/mlservices:/opt/mssql/lib/zulu-jre-11:/opt/mssql-tools
2021/08/02 01:32:41 Drop permitted effective capabilities.
2021/08/02 01:32:41 [launchpadd] INFO: Polybase remote hadoop bridge disabled
2021/08/02 01:32:41 [launchpadd] INFO: Launchpadd is connecting to mssql on localhost:1431
2021/08/02 01:32:41 [launchpadd] WARNING: Failed to connect to SQL because: dial tcp 127.0.0.1:1431: connect: connection refused, will reattempt connection.
2021/08/02 01:32:42 [launchpadd] WARNING: Failed to connect to SQL because: dial tcp 127.0.0.1:1431: connect: connection refused, will reattempt connection.
2021/08/02 01:32:43 [launchpadd] WARNING: Failed to connect to SQL because: dial tcp 127.0.0.1:1431: connect: connection refused, will reattempt connection.

How can I fix this?

The command I ran at end of step 5

docker run --cap-add SYS_PTRACE -e ‘ACCEPT_EULA=1’ -e ‘MSSQL_SA_PASSWORD=Password.1’ -p 1433:1433 --name azuresqledge -d mcr.microsoft.com/azure-sql-edge

Solution 1:

You need to run the command with proper quotes or without them. Also, use a stronger in SA_PASSWORD.

The below command worked without an issue.

docker run -d --name SQLServerImg -e ACCEPT_EULA=Y -e SA_PASSWORD=StrongPassword@123 -p 1433:1433 mcr.microsoft.com/azure-sql-edge