SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Loopback available for Windows Containers

The April 2018 update for Windows brought a few cool things but the best one (imho) is that now we can now connect to Windows containers locally using ‘localhost’ and the port specified upon container runtime.

Let’s have a look at how this works.

First, spin up a container:-

docker run -d -p 15789:1433 `
    --env ACCEPT_EULA=Y `
        --env SA_PASSWORD=Testing1122 `
            --name testcontainer `

Previously, if we wanted to connect to the container locally, we would have had to grab its Private IP by running: –

docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' testcontainer

Not any more though! We can now use ‘localhost’ and the port number.

This update was available for a while in the Windows 10 insiders track but it’s now gone GA. Pretty cool as this functionality has been around for Linux containers since, well, forever. ??

Thanks for reading!

The DBA Who Came In From The Cold

I’m Andrew Pruski and I am a SQL Server DBA with 5 years experience in database development and administration.

The online SQL Server community has helped me out immensely throughout my career, whether from providing reference material in blog posts, or answering my (sometimes obscure) questions on forums. So, to try and say thank you, I would like to contribute my own experiences in the hope that they could benefit someone out there.

So here’s my general ramblings and thoughts about working as a SQL Server DBA.

You can find me on twitter @DBAFromTheCold

If you have any feedback on my blog please send me an email to dbafromthecold@gmail.com.


Leave a comment on the original post [dbafromthecold.com, opens in a new window]

Loading comments...