Run SQL Server in Docker!
HTML-код
- Опубликовано: 12 авг 2022
- Learn how to run an instance of SQL Server in a Docker Container.
This is a great way to run and test applications against a local database. Try out all your changes locally before going to dev, test or production!
#docker #sql #programming
Add volumes to persist your data, even if you delete the docker container!
SQL Server Docker Hub page:
hub.docker.com/_/microsoft-ms...
Documentation for volumes and persisting data:
docs.microsoft.com/en-us/sql/...
Deploying to a vps using docker is so differs from classic hosting. Thank you sooooo much for enlightning this things. My gratitude knows no bounds
You’re welcome. Thanks for watching
Thank you, ive never come across this channel before this is my first time, but from what i seen so far your teaching skills are nice, a short very explanatory video that gave me exactly what i requested for within few minutes . Thanks
I appreciate the kind words. Glad you found it helpful!
Would be nice another video describing how to use certificates to access sql server on docker (Linux)
Clear and easy within short time, great stuff, thanks a lot
Thanks for watching!
The bit about adding a path to the local folders to make sure the data isn't wiped when the container is removed was invaluable - this helped me get mssql running on Synology NAS
That’s an interesting way of doing it. Does that mean you’re only putting the data on the NAS, or are you somehow running docker/sql on there as well?
How’s the performance?
Thanks for this video. I was having a problem configuring the mapped volume. Turns out I needed the "-d" parameter in the "docker run" command to be AFTER the "-v" parameters and not before. Then it worked 👍
Great video, thanks for explaining it so clearly!
Glad it was helpful!
Thankyou very much, especially the mentioning about Azure Data Studio, amazing stuff. Looking for a long time, for a clean, elegant tool.
Yea it’s a great light weight tool for the day to day stuff. Thanks for watching!
Great video. I learned a lot about using containers and how the interact with SQL. thanks
Glad you enjoyed it!
Thanks for clear and useful informations :)
You’re welcome
Thanks for the video, really helpful
You’re welcome, thanks for watching!
Great tutorial in setting up and persisting sql server DBs locally. Will use that for development rather than using Azure Sql Servers to save a little money before publishing. Much thanks.
Ya it’s a great way to save some money during development.
Thanks for watching!
pretty cool, didn't even think about mapping storage to persist the data :D
now, to elevate this... it would be great to utilize my visual studio database projects in the container build.. somehow.
I’m glad you found it helpful!
Don’t forget about post number , [port] after server name and also to trust the certificate
Thank you for Azure Data Studio - didn’t know that…
Nice and easy, thanks
You’re welcome!
You are greate
Hey there, Kudos to your great efforts in this channel.
I am a new sql learner with simple enquiry.
Could i install on my pc only sql server management studio without an sql server?
The reason that our company has a dedicated server machine, so would i need only to install
the sql studio to access the server?
Thanks for taking care of my enquiry.
Hello, thanks for watching!
Yes, you can install SQL Server Management Studio (SSMS) on your pc without installing SQL Server, and that will also allow you to connect to your companies SQL Server.
If you google "SSMS Download" one of the first results should be the download page from Microsoft. It is a free download.
explination is good,
after creating the containers without using volumes when i created the table and delete the container but the data is still persisting. i followed the same process can anyone suggest me the solution for this whats the reason for this.
Excellent instruction but how i can limit ram and memory usage in image . It alway use 70-80% ram ( i have 16gb ) . only find instruction for macos and linux
OK Great Job! 👍👍 - need to go ahead and make a .NET Core Web App to put in a container now.....
I'm struggling with the initial setup. docker pull command for 2022 worked initially but on the second step of adding a password I received an error: "docker run requires at least 1 argument" now all of my input returns "command not found"
The error "docker run requires at least 1 argument" generally means you forgot the image name, or options are not where the should be.
Hi, I hope you could help me, I have been searching for hours how to get SQL and I came across your video. When doing the server connection, i got an error but it said something along the lines that i could still go ahead by pressing a blue button so i did and connection it looks fine, any advice should i have not done that? Next, the connection was succesful is the data base stage necessary or is SQL now downloaded and ready? (im a total noob trying to get into data sorry if its a dumb question)
It's tough to tell what the error might have been. It may have been asking to accept/approve the secure connection?
Hi, Would you run a mssqlserver in a docker on Google Cloud Run (GCR) and in that case where would your create the external mdf/ldf volumes ? And is Google allowing that ?
No, Cloud Run doesn’t have a persistent disk so there’s no way (that I know of) to hook it up. You’d want to use Cloud Sql, a vm on Compute Engine, or kubernetes.
@@scriptbytes Thanks again!
Hi your videos are really informative. I have downloaded the azure studio and docker. But I am unable to connect server any advice?
Is it giving an error/message?
I agree with most - video is cleary, is a good video, BUT I can't get it to work. I have tried it in powershell, CMD, and BASH. I am working on a mac with docker desktop. if you have any suggestions please help. I can't get past the connecting to the server part at around 2:00
It's tough to tell what it might be, but I would check a few things: 1. If you're on an M1/M2 mac you'll need to use a SQL Edge docker image instead of SQL Server because there's no ARM version of SQL Server. 2. Make sure your password is "strong" enough. SQL I think enforces password strength by default. 3. Maybe try 127.0.0.1 instead of localhost for connecting?
I recently got an M1 Macbook, and I've had a few people say they're having issues following this video on their Macs, so maybe I'll do a quick video in the next week or so on doing the same thing from a mac.
I am having issues installing SSMS on my computer. Does install SQL Server this way with Docker/ADF install all the dependencies to run SSMS without anything preinstalled?
No, SSMS is a separate install if you want to use that to connect/query your database.
Running the docker command in window with -v, docker container will stop working after few seconds. I have to remove the -v but the data is not persisted.
Hard to tell what it might be. In Docker Desktop, after the container has run and stopped, you can click on the container and then check the logs tab at the top, there might be details in there about what is making it stop right away.
If I had to guess, it's either:
1. the password isn't strong enough because I think MSSQL enforces password requirements (capital letter, number, symbol, etc.)
2. Docker doesn't have permissions to write to the folder you gave it.
3. The path doesn't exist
Hope you get it working!!
Great Video. The SQL container image from microsoft contains SQL Express version.
How would run a container with a Full SQL server version for a large corporate application?
Thank you
The container has all the versions, there is another option you can pass in that tells it which to use: -e "MSSQL_PID= Standard". PID stands for Product ID. There is also an option for Enterprise.
Great, many thanks
With this sql image can I run an Integration Services (SSIS) ETL?
Good question. I'm not actually sure, I don't use SSIS much. Hopefully someone can chime in and help you out!
anyone can tell how to join this sqlserver to Active Directory, and enable AD auth for users?
Unfortunately I don't have any experience connecting a SQL Server to AD. Hopefully someone else can chime in to help you out!
i dont know why but now i see the title source Microsoft not blue and title change to Microsoft SQL Server - Ubuntu based images and i cant make it work on my m1pro work, can u make new one to help me, or give me some advice
The SQL Server image won't work on Apple Silicon chips because there's no ARM version.
However you can use SQL Edge (hub.docker.com/_/microsoft-azure-sql-edge), it works on M1 macs.
@@scriptbytes i had made mssql(docker) work on my mac before, but after i ease my mac, then i down new version of docker and i do fl any video on utube and til now it didnt work
@@scriptbytes i see status exited(1) after i run commandline docker.. on terminal.
Failed to read packet: EOF (docker)
@@scriptbytes Thanks, works for me on a M1 pro
For something that is suppost to stop the age old problem: "but it works on my computer". This deos not work on my computer
Any specific errors or issues?
... Now show us how to license it to run production workload 😏
There’s another environment variable for that:
MSSQL_PID
Pass it your product id and you should be set
learn.microsoft.com/en-us/sql/linux/sql-server-linux-configure-environment-variables?view=sql-server-2017#environment-variables