Minimal setup to run two SQL Server containers and an Nginx TCP proxy for testing linked-server behavior.
- Docker Desktop (macOS/Linux).
- On Apple Silicon (M1/M2) optional: install Rosetta and enable Docker Desktop 'Use Rosetta for x86/amd64 emulation' if you plan to run amd64 images.
- Install Rosetta: sudo softwareupdate --install-rosetta --agree-to-license
./scripts/run_all.sh
The script uses the mssql-tools container (amd64) and includes --platform linux/amd64 where needed.
Ports (host -> container)
- nginx proxy to mssql1: 1433 -> (proxied to mssql1)
- nginx proxy to mssql2: 1434 -> (proxied to mssql2)
- direct mssql1 host mapping: 14331 -> container 1433
- direct mssql2 host mapping: 14332 -> container 1433
-
Run a single SQL file against mssql1 via the proxy using the helper container (Apple Silicon: include --platform):
docker run --platform linux/amd64 --rm -it -v "$(pwd)/sql:/work" mcr.microsoft.com/mssql-tools:latest
/opt/mssql-tools/bin/sqlcmd -S host.docker.internal,1433 -U sa -P 'YourStrong!Passw0rd' -i /work/test_linked_server.sql -
Or connect directly to mssql2 to list databases:
docker run --platform linux/amd64 --rm -it mcr.microsoft.com/mssql-tools:latest
/opt/mssql-tools/bin/sqlcmd -S host.docker.internal,14332 -U sa -P 'YourStrong!Passw0rd' -Q "SELECT name FROM sys.databases;"
- The project includes:
docker-compose.yml- services and portsnginx/nginx.conf- TCP stream proxy configsql/- helper SQL scripts used byscripts/run_all.shscripts/run_all.sh- orchestrates init, startup, and SQL tests
- If you need full SQL Server parity (linked servers), this compose uses full SQL Server images with
platform: linux/amd64(emulated on Apple Silicon). If you prefer a native ARM image, use Azure SQL Edge but be aware it does not support sp_addlinkedserver.
- Check logs: docker compose logs -f mssql1 mssql2 nginx
- Check container status: docker compose ps
- If services fail to start due to permissions, run the init job manually as shown above.