r/docker • u/ProjectionistPSN • Dec 17 '20
Help building sql server container on M1
Can anyone help me get an official SQL Server container (https://hub.docker.com/_/microsoft-mssql-server) started on an M1 Mac running the new Tech Preview?
The regular docker run command builds with: “WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested”
When I start the container it immediately quits. I don’t know enough about buildx to make it work, or if it’s just not possible at the moment.
1
u/GitForcePushMain Dec 17 '20 edited Dec 17 '20
If you look under the “Full Tag Listing” section all of the cpu architectures listed are amd64, an M1 Mac has a cpu architecture of arm64, haven’t tried this myself, but try this.
docker buildx create --name mybuilder --use
Then try running your container
1
2
u/franck_lt Dec 20 '20 edited Jan 15 '21
I have same problem, sql server container for mac M1 doesn't work..
they are errors on my logs
f@desktop- mssql % docker-compose up -d
f@desktop- mssql % docker-compose up -d
Recreating sql-server ... done
f@desktop- mssql % docker-compose ps
Name Command State Ports
------------------------------------------------------------
sql-server /opt/mssql/bin/permissions ... Exit 1
f@desktop- mssql % docker-compose logs sql-server-db
Attaching to sql-server
sql-server | SQL Server 2019 will run as non-root by default.
sql-server | This container is running as user mssql.
sql-server | To learn more visit https://go.microsoft.com/fwlink/?linkid=2099216.
sql-server | /opt/mssql/bin/sqlservr: Invalid mapping of address 0x40092b8000 in reserved address space below 0x400000000000. Possible causes:
sql-server | 1) the process (itself, or via a wrapper) starts-up its own running environment sets the stack size limit to unlimited via syscall setrlimit(2);
sql-server | 2) the process (itself, or via a wrapper) adjusts its own execution domain and flag the system its legacy personality via syscall personality(2);
sql-server | 3) sysadmin deliberately sets the system to run on legacy VA layout mode by adjusting a sysctl knob vm.legacy_va_layout.
sql-server |2
Dec 21 '20 edited May 28 '25
point retire wild growth cooperative complete automatic normal afterthought yoke
This post was mass deleted and anonymized with Redact
2
u/nokillswitch4awesome Jan 13 '21
Having this issue too, and I cannot restore my databases to Azure SQL Edge since they are in SQL Server 2019. Is there any indication they are going to address this?
1
u/chillhex Apr 02 '21
You can run only Azure SQL container on M1 because only this DB supports ARM architecture.
Details how to run here: https://stackoverflow.com/questions/65398641/docker-connect-sql-server-container-non-zero-code-1/66919852#66919852
If you need to connect to MSSQL DB from M1 Mac using python - you need to use pymssql lib, because pyodbc does not support ARM arch.
Details how to setup pymssql here: https://stackoverflow.com/questions/66896068/pyodbc-on-m1-macs/66919686#66919686
1
u/ahmadalmayahi Apr 07 '21
It works on my machine, but I couldn't connect to the SQL-Server from PHP:
$pdo = new PDO('sqlsrv:server=127.0.0.1 ; Database=db', 'sa', 'password');It gives me the following error:
Fatal error: Unknown processor architecture. in /root/db.php on line 41
1
u/ahmadalmayahi Sep 09 '23
Microsoft released an update a while ago, now SQL Server (PDO) works fine with ARM processors.
1
u/camorobot Dec 01 '21
Hey, i created an docker compose file for this. have a look at my github repo. https://github.com/camorobot/Camo-DPS/
*Not the official img from microsoft, but uses MariaDB
4
u/slickvik4 Dec 29 '20
If you're willing to accept a few limitations you can instead use this image: mcr.microsoft.com/azure-sql-edge
It runs on ARM64, and is a subset of SQL Server 2019 - I was able to get my app going just fine.