Skip to content

Instantly share code, notes, and snippets.

@nirdosh17
Last active January 30, 2020 05:01
Show Gist options
  • Save nirdosh17/c443a32f01fb2b827ed0ae777fd27ba2 to your computer and use it in GitHub Desktop.
Save nirdosh17/c443a32f01fb2b827ed0ae777fd27ba2 to your computer and use it in GitHub Desktop.
Start Microsoft SQL server using Docker and connect it with Azure Data Studio
# -------- Usage -----------
# 1. Download this file and save as docker-compose.yaml
# 1. Go to the downloads folder and run command: docker-compose up
# To close the server: Either do 'CTRL + C' OR 'docker-compose down'
# 2. Open Azure data studio
# 3. Create new connection with following settings:
# Connection Type: Microsoft SQL Server
# Server: localhost,1433
# Authentication Type: SQL Login
# User name: SA
# Password: StrongPW12345!
# Database: Default
# Server Group: Default
# 4. Since SQL data folder from the container is mounted to your machine ~/.docker/mysql folder, all data(dbs, tables) will be retained even when the container is stopped/killed.
# If you want to clean up everything, just delete the folder(~/.docker/mysql) from your machine.
version: "3.1"
services:
sqlserver:
image: mcr.microsoft.com/mssql/server:2017-CU8-ubuntu
volumes:
- ~/.docker/mysql:/var/lib/mysql
ports:
- "1433:1433"
environment:
- ACCEPT_EULA=Y
- SA_PASSWORD=StrongPW12345!
@SnehaNeupane
Copy link

Really very helpful stuff! Thank you Nirdosh for the wonderful work with all the details. Appreciate it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment