I have a docker compose file which creates a starts SQL Server. This is working fine. I can connect to the database and see the master database.
What I am trying to do is create a new database, add a table and some data to that table. I have been unable to find an example doing this using SQL SEever. All the example I have found are either using PostgreSQL or Mysql.
I have tried to adapt this example Docker Compose MySQL Multiple Database
I have created an init directory with a file called 01.sql and the only thing in it is
CREATE DATABASE `test`;
My docker-compose.yml looks like this
services:
db:
image: "mcr.microsoft.com/mssql/server"
ports:
- 1433:1433
volumes:
- ./init:/docker-entrypoint-initdb.d
environment:
SA_PASSWORD: "password123!"
ACCEPT_EULA: "Y"
When I run docker-compose up
I'm not seeing anything in the logs that implies its even trying to load this file. When I check the database I am not seeing any new database either.
I am at a lost to understand why this isn't working for SQL Server but the tutorial implies that it works for MySql. Is there a different command for SQL Server?