10

Running SQL Server 2019 CTP in a Docker container

If you’ve been anywhere near social media this week you may have seen that Microsoft has announced SQL Server 2019.

I love it when a new version of SQL is released. There’s always a whole new bunch of features (and improvements to existing ones) that I want to check out. What I’m not too keen on however is installing a preview version of SQL Server on my local machine. It’s not going to be there permanently and I don’t want the hassle of having to uninstall it.

This is where containers come into their own. We can run a copy of SQL Server without it touching our local machine.

The post below will run through step-by-step how to install docker and get an instance of SQL Server 2019 up and running.

First, go to the Docker Store and download the Docker for Windows Community Edition (CE). Yes, unfortunately this is going to ask you to register but that gives you access to the Docker Hub which is pretty cool (for more info on that, see here).

Double click the .msi and accept the default setting of linux containers (yep, going to run SQL on Linux on Windows 10! For more information on this, check here).

You’ll then get the installation dialog: –

You’ll be asked to log out and log back in once the install is complete: –

Once you log back in, Docker will start automatically. It’ll scan your system to verify that the prerequisites are all there (the hyper-v and containers feature). If not, it’ll prompt you: –

Let your system restart and then log back in. Docker will start automatically: –

Now you can run your first docker command! I like to keep it simple and just check the version that docker is running: –

docker version

If you get a client and a server version back you’re good to go!

What you need to do now is pull the 2019 CTP image. I’m going to go for the ubuntu image so run: –

docker pull mcr.microsoft.com/mssql/server:vNext-CTP2.0-ubuntu

When that’s complete, verify that the image is on your machine: –

docker images

So now you can run a container!

docker run -d -p 15789:1433 --env ACCEPT_EULA=Y --env SA_PASSWORD=Testing1122 --name testcontainer mcr.microsoft.com/mssql/server:vNext-CTP2.0-ubuntu

N.B. – For more information on what’s going with this statement, check here

That’ll come back pretty much immediately, to check that the container is running: –

docker ps -a

Then connect in SQL using localhost,15789, and boom!

How awesome is that! An instance of SQL Server 2019 CTP 2.0 up and running on your local machine. If that’s peaked your interest into learning more about containers, I have put a list of all the blog posts I’ve written here.

Thanks for reading and have fun with SQL in containers!

1

Taking the Linux plunge – Update

It’s been a couple of weeks now since I took the plunge and bought myself a Dell XPS 13 running Ubuntu 16.04.

And to be honest, so far so good! The machine itself is absolutely fantastic and apart from one issue now resolved, Ubuntu has been great to use. I used it to present my partitioning session at the Dublin User Group this week and all went well. Using SQL in a docker container and SQL Operations Studio, my demos worked no problem.

Have to admit, the only gripe I have is that there’s a windows key instead of a key with the Ubuntu logo 🙂

So once I had booted up the first thing I did was uninstall Chrome and Chromium. After that, I went and installed: –

Firefox– with DuckDuckGo as my homepage
Docker
SQL Operations Studio
Visual Studio Code
Powershell
Remmina
Franz
Spotify
Whatever – Evernote client for Linux
Keybase

OK, there’s a couple of obvious ones in there but maybe a couple that are new to you.

If you haven’t heard of Franz, it’s awesome. One of my pet peeves these days is the amount of comms apps that I have to have open. Slack, Google Hangouts, Teams, email etc. it’s a bit of a nightmare. Franz solves that issue by combining them all into one app, ok it’s a bit of a memory hog but that’s kinda to be expected.

Another app not everyone may be familiar with is Keybase. Keybase is a security app that provides public keys, encrypted chat, and an encrypted filesystem. The filesystem offering is why I went for it, you can install OneDrive on Linux but it’s a bit of a hassle and I’m not a particular fan of Dropbox so am glad that I have another option (even if it is ANOTHER chat app, and it doesn’t integrate with Franz 😦 )

One final thing to mention is Gitpitch. Gitpitch is a markdown presentation service that integrates with Github/Gitlab/Bitbucket. You write your presentation in markdown, push it to a repo, and the service renders your presentation online (which you can then download).

I used GitPitch for my presentation to the Dublin User Group this week and was a bit concerned at first as my markdown skills are, ahem, not great. You can see the presentation I wrote here, I’m really pleased with the results. I also really enjoyed creating that presentation, which is new for me as I hate writing powerpoint slides. Am going to spend some more time this weekend seeing what else the service can do.

So all in all, am really pleased with my new toy. If you’re thinking about switching to Linux, I highly recommend that you do, what’s the worst that could happen? 🙂

Have a good weekend!

0

SSL Provider error 31 when connecting to SQL in a docker container

I recently bought a Dell XPS 13 running Ubuntu 16.04 and ran into an issue when connecting SQL Operations Studio (version 0.31.4) to SQL 2017 CU9 running in a docker container. Other people seem to encountering this issue as well so am posting it so that it may be of some help to someone in the future.

The error generated was: –

System.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 31)

The full error can be viewed here

I was a bit stumped with this one to be honest, I googled around but could not find a resolution.

So I reached out on twitter to get some help: –

I also logged an issue on the SQL Operations Studio Github

Thankfully I got a response from Kevin Cunnane (t): –

Kevin advised me to run: –

sudo update-ca-certificates --fresh

N.B. – See here for a detailed description of what this command does

Once I ran that I was able to connect to SQL running in a docker container from SQL Operations Studio. Many thanks Kevin!

Hope that helps!

0

Evening or morning poll results!

And the results of the poll are in!

Evening just scraping it! So there’s a pretty even mix out there, interesting. Thanks to all who voted, was good fun reading all the comments on twitter.

A lot of morning voters said that they used to be evening people but have now changed. I’m betting have children played a big part in that 🙂

I’ll leave that poll open in case anyone else wants to vote.

Have a good weekend!

0

Are you a morning or evening person?

I am not a morning person. I’ve really tried but there’s something in me that just stops me from getting out of bed, even though I know I should.

I have friends who get up at 05:30 every day and for me, that’s the middle of the night!

It doesn’t really matter however, I’m a productive person…just not before 9am in the morning. I tend to do most of my personal work (blogging, writing/practicing presentations) in the evening so have always made time when I am most productive.

I’m also really lucky with my current position as the rest of my team is based in the US so there’s no point in me getting up early to work, as I’d completely miss their work day.

Well, that’s what I tell myself anyway (and I’m sticking to it).

What about you? I’d love to know if you’re a morning or evening person? Would be interesting to see the ratio for DBAs out there.

Have a good week!