Using docker compose (and ACI integration), I start services to be run in Azure Container Instances. One of the service is SQL Server 2019 docker container. It takes a moment to get the containers up and running. However, even if the SQL Server container is then in running state and the log shows it has successfully started, it takes quite long (a few minutes) for the SQL Server to be able to accept connections.
Does somebody know why it takes that long?
So when trying to connect to the server using sqlcmd, I keep getting the following response for a few minutes later right after the server has started:
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Login timeout expired.
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : TCP Provider: Error code 0x102.
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online..
UPDATE [2021/12/22]:
I wonder also why the "top" command executed from within the DB container shows the following. The mssql process uses almost 100% CPU. However, the overall status of the CPU (please see the row "%Cpu(s):") shows the CPU is 66% idle. Does somebody know why?