I am trying to create multiple SQL server containers on a Linux host. The problem I face is that after I create the first container, every other created container after this just exits with a code 1. I am using the same Docker image I used for the very first container which has no issues what so ever. I am in a predicament at this moment and this is what docker logs
show me.
The following was used to create the first docker container.
sudo docker container run -d -i -t \
--publish 1434:1433 \
--volume mssqlsystem:/var/opt/mssql \
--volume mssqluser:/var/opt/sqlserver \
--env ACCEPT_EULA=Y \
--env MSSQL_SA_PASSWORD=**** \
--env MSSQL_DATA_DIR=/var/opt/sqlserver \
--env MSSQL_LOG_DIR=/var/opt/sqlserver \
--name sql2 \
mcr.microsoft.com/mssql/server:latest
The following command was used to create the second container which has been exiting.
sudo docker container run -d -i -t \
--publish 1435:1433 \
--volume mssqlsystem:/var/opt/mssql \
--volume mssqluser:/var/opt/sqlserver \
--env ACCEPT_EULA=Y \
--env MSSQL_SA_PASSWORD=**** \
--env MSSQL_DATA_DIR=/var/opt/sqlserver \
--env MSSQL_LOG_DIR=/var/opt/sqlserver \
--name sql3 \
mcr.microsoft.com/mssql/server:latest
Docker logs show the following error for container 2:
*SQL Server 2019 will run as non-root by default.
This container is running as user mssql.
To learn more visit https://go.microsoft.com/fwlink/?linkid=2099216.
2021-02-11 22:38:47.98 Server Setup step is copying system data file 'C:\templatedata\master.mdf' to '/var/opt/mssql/data/master.mdf'.
2021-02-11 22:38:48.10 Server ERROR: Setup FAILED copying system data file 'C:\templatedata\master.mdf' to '/var/opt/mssql/data/master.mdf': 2(The system cannot find the file specified.)
ERROR: BootstrapSystemDataDirectories() failure (HRESULT 0x80070002)
sqladmin@vmsqlubuntu01:~$ sudo docker logs -f 213fb583fd80
SQL Server 2019 will run as non-root by default.
This container is running as user mssql.
To learn more visit https://go.microsoft.com/fwlink/?linkid=2099216.
2021-02-11 22:24:51.37 Server Setup step is copying system data file 'C:\templatedata\master.mdf' to '/var/opt/mssql/data/master.mdf'.
2021-02-11 22:24:51.50 Server ERROR: Setup FAILED copying system data file 'C:\templatedata\master.mdf' to '/var/opt/mssql/data/master.mdf': 2(The system cannot find the file specified.)*
What could be wrong here? The Linux host is a 8 GB memory and 2vCPU on Azure. This is a POC host so the configuration has been kept bare minimum. Will capping the memory of the first Docker host help in any way?
User contributions licensed under CC BY-SA 3.0