I'm trying to create a docker container to use from docker for windows as a test instance for a sql server database. I have a backup file MyDb.bak that I would like to restore as part of the container creation
Currently my dockerfile looks like this
FROM microsoft/mssql-server-linux:latest
ENV ACCEPT_EULA="Y"
ENV SA_PASSWORD="<my_sa_password>"
COPY ./MyDb.bak /var/opt/mssql/data/MyDb.bak
ENTRYPOINT /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P <my_sa_password> -Q "RESTORE DATABASE [MyDb] FROM DISK = N'/var/opt/mssql/data/MyDb.bak'"
docker problem: The entry point command runs before sql server is spun up and I can't find how to delay it until a connection is possible
sql problem: I can't restore the database when I run the restore script manually because it can't find whatever an mdf file is
Msg 5133, Level 16, State 1, Server c15ec76da554, Line 1
Directory lookup for the file "C:\SQLData\MyDb.mdf" failed with the operating system error 2(The system cannot find the file specified.).