Monday , December 23 2024

Installing Docker And SQL Server 2017 On LinuxVM In Azure

In today’s article, I will talk about Installing Docker And SQL Server 2017 On LinuxVM In Azure.

After the announcement that SQL Server 2017 is running on Docker, I was working on docker and today I will tell you “Installing Docker and SQL Server 2017 on LinuxVM in Azure”. I have a LinuxVM on Microsoft Azure for test run. You can see the features of this machine below.

After connecting to the Linux VM via SSH, what we need to do is update our package list with apt-get update.

After updating the package list, we install the necessary package to be able to install packages over HTTPS.

As the third step, we add the Docker official GPG key.

We add the Docker repo to our apt repos.

We are updating our package list again to be able to install Docker CE.

We run the code below to install the latest version of Docker Ce.

We have completed the Docker installation on LinuxVM, let’s see our Docker running first.

Let’s write a simple “Hello World” Text to test docker now.

As you can see, we have successfully completed the docker installation. Now it’s time to install SQL Server 2017 on the docker we installed.

Before starting the SQL Server installation, we need to get the Linux image of SQL Server 2017 from Docker Hub. For this ;

Now that we’ve pulled the image of SQL Server 2017, we now need to run the image on docker. For this process ;

The SA password that we will define here must be a complex password, otherwise the sql server service will not start. As you can see, we also defined the installation.

Now let’s list the containers running with the “docker ps” command. If we ran a “docker ps -a” run, we would also see the containers that were running and stopped.

Yes, as you can see, our docker is running, we also have a container on which we installed sql server 2017 and it has been up for 2 minutes. Finally, let’s access this database server.

sqlcmd can also be used during the connection phase. Let’s give our first connection example via SQLCmd.

As you can see, SQL Server 2017 is running on docker and we learned the version information. Well, let’s get some server information such as ServerName with SQL Operation Studio.

After installing SQL Operation Studio, we write our server information as below and click connect.

After the connection process is completed, we run the following code block and learn the basic information about the server.

As you can see, the values returned in the query result return the container ID information to us.

We have come to the end of another article. We will continue our articles on Docker. See you.

Footnote: You can connect not only with SQL Operation Studio, but also with an up-to-date SQL Server Management Studio v17.x.

 

 

 

 

Loading

About Çağlar Özenç

Leave a Reply

Your email address will not be published. Required fields are marked *