Failed to import the .bacpac with docker SQL Server

75 views Asked by At

I have my docker run command like below.

docker run -d -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=P9gjYCcaT8uXiBki" 
           -v c:\sqlpackage:/opt/sqlpackage -v c:\dkc.bacpac:/tmp/dkc.bacpac 
           -p 1433:1433 --name mssql-server-example mcr.microsoft.com/mssql/server:2019-CU8-ubuntu-18.04

Post this SQL Server able to come up & I wanted to import DB from the .bacpac file like below.

docker exec 89b4b9e35166 /opt/sqlpackage/sqlpackage 
       /a:Import /tsn:localhost /tdn:digitalkey /tu:sa 
       /tp:P9gjYCcaT8uXiBki /sf:/tmp/dkc.bacpac

But I am getting an error as shown below. I tried providing the server name as "localhost" or "*:1433" but not working.

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 35 - An internal exception was caught)

Any info could be helpful.

0

There are 0 answers