24
Run SQL Server in Docker container
First you must have Docker install in your machine if not check this link :docker
to run sql server create a file named docker-compose.yml in folder of your project
version: "3.3"
services :
sqldata:
image: mcr.microsoft.com/mssql/server
environment:
- SA_PASSWORD=Pass@word
- ACCEPT_EULA=Y
ports:
- "1433:1433"
We can now acces to our container by passing to mode bash of our image :
$ docker exec -it 'name_of_image' 'bash'
After execute the image in mode bash you can connecte to database using sqlcmd :
24