I’m working with Docker running on Windows or Linux. There are other ways to do this, but Docker seems to be a pretty strong standard. I’ll leave it to you to get Docker installed on your system. Go here to get the appropriate installation.

I explain why I’m learning Docker and containers here if you’re interested.

Docker Pull

The first command you have to learn is ‘docker pull’. You then have to supply something for it to pull, an image that will be used to create your containers. I’m using Powershell for the commands I’m posting this week. Here’s how you get an image with SQL Server 2017:

docker pull mcr.microsoft.com/mssql/server:2017-latest 1 docker pull mcr . microsoft . com / mssql / server : 2017 - latest

Assuming you have Docker installed and running, you should get an image downloaded. Depending on your network bandwidth, this could take as much as 3-5 minutes. It may be as little as around 90 seconds or so. Either way, you now have what you need to run a container with SQL Server 2017.

Now, what if you want to muck about with SQL Server 2019 CTP? Simple, just change the pull command:

docker pull mcr.microsoft.com/mssql/server:2019-CTP2.5-ubuntu 1 docker pull mcr . microsoft . com / mssql / server : 2019 - CTP2 . 5 - ubuntu

This is getting very specific in the image being pulled. Unlike last time, where we just specified the latest image, this time we’re asking for a particular release and a particular OS.

For a complete listing of the images that Microsoft has published through the Docker Hub, go here.

You can get a list of the images that you’ve pulled or created locally:

docker images 1 docker images

That will show you everything you need. If there’s an image you don’t want around, you can get rid of it. Just run this

docker rmi <IMAGE ID> 1 docker rmi & lt ; IMAGE ID >

and, if necessary

docker rmi <IMAGE ID> -f 1 docker rmi & lt ; IMAGE ID > - f

If you need help with any of the docker commands, do this:

docker --help docker rmi --help docker pull --help 1 2 3 docker --help docker rmi --help docker pull --help

Conclusion

We’re just getting started. This post shows you how to get an image down to your machine so that you can create containers from it using ‘docker pull’. Tomorrow, I’ll show you a couple of ways to create a SQL Server container.

I have several upcoming all day seminars. One is on Query Tuning and the others are on DevOps. Please check the links for details:

SQLSaturday Columbus Precon, June 7 2019, Columbus OH

SQLSaturday Indianapolis Precon, Friday August 16th, 2019. Click here now to register.

SQLSaturday Oslos Precon, Friday August 30th, 2019. Click here to register.

Share this: Twitter

Facebook

Reddit

LinkedIn

Tumblr

WhatsApp

Pocket

Email

