title: Trouble restoring sql server DB on docker container
body: <p>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</p>
  
  <p>Currently my dockerfile looks like this </p>
  
  <pre><code>FROM microsoft/mssql-server-linux:latest
  ENV ACCEPT_EULA="Y"
  ENV SA_PASSWORD="&lt;my_sa_password&gt;"
  COPY ./MyDb.bak /var/opt/mssql/data/MyDb.bak
  ENTRYPOINT /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P &lt;my_sa_password&gt; -Q "RESTORE DATABASE [MyDb] FROM DISK = N'/var/opt/mssql/data/MyDb.bak'"
  </code></pre>
  
  <p><s>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</s></p>
  
  <p>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</p>
  
  <pre><code>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.).
  </code></pre>