Open marshallw opened 1 year ago
I'll also add that If I remove any sqlcmd commands, let the image start up, I can connect to it after startup is complete. It seems to be during building or composing that I'm having issues.
You kind of need 2 containers.. the first for the sql server, the second to restore from backup command.
Also, you should do a volume mount to /backup inside your sql server container... this will let you access the backup file from "inside" sql, which is needed...
Hello! I'm trying to set up an integration test environment with the the mssql image, and i'm having a lot of difficulty restoring a database backup after spinning up a mssql docker container. Virtually everything I try just results in a timeout connecting to the sql server with
sqlcmd
. I've tried setting the -S parameter tolocalhost
,localhost,1433
,127.0.0.1,1433
,127.0.0.1
,0.0.0.0
,0.0.0.0,1433
andintegrationtest
.For reference, I am using the
mcr.microsoft.com/mssql/server
image.Here's the docker-compose file I tried creating:
Here are the logs from running this:
I also tried just building a docker image with the database already set up, but I ran into the same issue. In this one I copy over the backup file, start and wait for the sqlservr service then run my command. Same issue; Login timeout expired. (I just noticed I forgot the command to kill sqlservr, which i trimmed off while troubleshooting)
Any ideas on what I'm doing wrong here? Thanks in advance!