I am working with a MacBook M1 that runs a SQL Server database using microsoft-azure-sql-edge image. On the same laptop is running a Win 11 VM using Parallels where SQL Server Management Studio is installed.
The issue is that I can't connect to the database from the Windows VM. I tried to give a hostname to the database container and connect it to the host network using this docker compose config:
version: "3.9"
services:
mssql:
image: mcr.microsoft.com/azure-sql-edge:latest
command: /opt/mssql/bin/sqlservr
environment:
ACCEPT_EULA: "Y"
SA_PASSWORD: ${SAPassword}
stdin_open: true
container_name: sqlserver
hostname: sqlserver
network_mode: host
ports:
- 1433:1433
I tried to set sqlserver
as server name and enter the login for sa
but I get an error:
A network-related or instance-specific error occurred while establishing a connection to SQL Server