0

I have a problem implementing docker-compose.yml file for MS SQL Database container in Docker. I tried to set up "setup.sql" file within "volumes:" parameter but it did not worked out for me. Maybe wrong path? How to correctly set up empty database using ready .sql file stored on local host computer?

Here is the code without volumes parameter:

version: "3.7"
services:
  sql-server-db:
    container_name: sql-server-db
    image: mcr.microsoft.com/mssql/server:2019-latest
    ports:
      - "1433:1433"
    environment:
        SA_PASSWORD: "secret123new!"
        ACCEPT_EULA: "Y"
2
  • Does that answer your question? stackoverflow.com/questions/51050590/… Commented Jul 16, 2021 at 14:06
  • @DmitrijKultasev that certainly makes the file accessible from inside the container, but I believe it actually only works for the Express edition. In other editions you have you use a retry-with-sleep loop to wait for SQL Server to finish mounting, validating and upgrading system and user database files before it opens a socket to accept incoming connections, e.g.: import-data.sh Commented Jul 16, 2021 at 15:05

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.