Hand on Tutorial: How to Set up MSSQL Server 2019 on Ubuntu Docker from the scratch, Step by Step



Microsoft SQL Server 2019 deploy on Docker (Ubuntu 20)

Pre-requisites:
1. Docker desktop
a. download link: https://docs.docker.com/docker-for-windows/install/
b. install and signed
2. vscode (very help full):
a. download link: https://code.visualstudio.com/download

Lets start:

1. open vscode
2. open new terminal
3. docker ps – all the running images.
4. pull mssql 2019 image for linux (https://hub.docker.com/_/microsoft-mssql-server)
5. run command : docker pull mcr.microsoft.com/mssql/server:2019-CU10-ubuntu-20.04
6. once the installation over, we will check the docker desktop version if the image is listed there… we can run directly from the desktop, but we will use command line.
7. docker ps, to check the running images
8. run the image mssql: docker run -e ‘ACCEPT_EULA=Y’ -e ‘SA_PASSWORD=Asdf@1234’ -e ‘MSSQL_PID=Express’ -p 1434:1433 -d mcr.microsoft.com/mssql/server:2019-CU10-ubuntu-20.04 [change to our version, that we downloaded. I have my MSSQL running in my pc which is using this port 1433, so I will change the port to 1434]
9. lets check from mms DEVLEAD is my local instance
10. connect with the docker image. localhost,1434, so we can connect with the image.
11. create db, tables and insert data to the image instance, done
12. clone the image for our usage
13. clone/copy command : docker container commit 98ca7380c3fa mroyon/mssqlbase:latest [we need the existing instance ID: ]
14. running our instance on different port 1435
15. now connect with our image version mroyon/mssqlbase as localhost,1435, everything is there. both instance are running independently.
16. now commit.push to our own reposotiry [login to the reposotiry- already logged in as desktop docker is runnning on signed mode]
17. commit and push:
a. commit command: docker container commit 7176be3ae3b0 mroyon/mssqlbase:latest
b. push command : docker image push mroyon/mssqlbase:latest [login to docker hub and check if the image has been uploaded. will take a while..:( the first time, push will take time, after that, layers will be updated only. going to pause the vdo … brb]
18. lets check our reposotiry at docker hub, done, and we make it private
19. clean up everything…
a. docker image prune -a
b. stop all image from running command: docker stop my_container – done
c. remove containers: command: docker container rm [container id] – done
20. download our image from our reposotiry — docker pull
21. start the mssql image and login from management studio — docker run -e ‘ACCEPT_EULA=Y’ -e ‘SA_PASSWORD=Asdf@1234’ -e ‘MSSQL_PID=Express’ -p 1434:1433 -d mroyon/mssqlbase, update data is there
22. commit and push
Thats it. hope to share a bit,…… take care.. happy coding… 🙂

Software used:
1. VS2019: [httns://visualstudio.microsoft.com/downloads/]
2. Docker Desktop: [httns://dons.docker.com/docker-for-windows/install/]
3. Bandicam: [https://www.bandicam.com/]

––––––––––––––––––––––––––––––
Walk Around by Roa https://soundcloud.com/roa_music1031
Creative Commons — Attribution 3.0 Unported — CC BY 3.0
Free Download / Stream: https://bit.ly/walk-around-roa
Music promoted by Audio Library https://youtu.be/BimtUhUirnw
––––––––––––––––––––––––––––––

#MSSQL
#docker
#Ubuntu