16
Run SQL Server in Docker container
- Sql Server is one of most populare relation database technologie devloped by Microsoft. Its use to store and retrive, it used by applications that support transactional and analytical workloads.
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"
To lunch our db, we can run commande from commande line :
$ docker-compose up -d
After docker pullin the image and service run you can check if the information about the image by this commande :
$ docker ps
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 :
16