How to configure Docker client to work with insecure Docker registry [Video]

How to configure Docker client to work with insecure Docker registry [Video]

AuthorFullName__c
Andrey Granovsky
articleNumber
000005019
ft:sourceType
Salesforce
FirstPublishedDate
2021-03-10T08:44:36Z
lastModifiedDate
2021-03-10
VersionNumber
5


Video Transcript:
Hi. My name is Andrey. I’m from JFrog support. In this video I will show you how to configure a Docker client to work with insecure Docker registry.

So, let’s start. First, let’s configure the Docker installed. As you can see, I got this version of Docker installed. And now I will show you the HTTP settings under the Administration and Artifactory. The Docker access method is repository path. Here we can see examples of how to pull, push, and log in to this Artifactory instance with Docker client.

Here I configure the public server name. It’s called art-docker.com. I will use this server name to log in with the Docker client in the following example. So, what we need to configure in order to use Docker client and work with insecure registry? We need to go to the /etc/docker.

Here I have a pre-configured daemon.json. If you don’t have this file, you need to create it… And let me show you this… and configure the insecure registry with the server name that’s configured on the Artifactory site, the public server name, art-docker.com.

You need to configure it on the machine you want to access the Artifactory and connect the Docker client to work in insecure Docker registry. And now what I’m going to do… After configuring this file, you need to reload the daemon of Docker and restart Docker as well.

I will perform the systemctl daemon-reload and as well the systemctl restart docker. After configuring the insecure registry, I want to access, in our case it’s the art-docker server name of my Artifactory, for instance. I restarted the daemon and also the Docker.

Now I want to check if this configuration is working. First, I will configure it by executing the docker info command. As you can see, under insecure registries I have my Artifactory instance. It’s called art-docker.com. And now I’m ready to go. So, I can log into its instance.

And here we have an example of how to log in. I’ll use the docker login, and I use my admin user at art-docker.com. Now writing my password. And as you can see, I log in successfully. I configured the Docker client to work with insecure registry. I will just test by docker pull hello-world. As you can see, I pulled the image successfully.

In this example we will configure Docker to work with insecure Docker registry using the sub-domain method. As you can see, here is the HTTP settings screen on the Artifactory. Here I configured the Docker access method to sub-domain. And I will use this public server name to log into Artifactory, the art-docker.com. It’s the same as the previous example.

I’ve checked already that I have Docker installed successfully. You can see the version here. As previously, we will create or modify the Docker daemon file that is located in the /etc/docker. We need to configure the insecure registries in the daemon.json file located in the /etc/docker.

As I’m using the sub-domain method, I need to give Docker the repository name of the Artifactory. For the Artifactory, I have a virtual Docker repository that aggregates local and remote Docker repositories. In the sub-domain I need to configure this specific repository before the public server name. So, it will be docker.art-docker.com. So, it’s the part of the server name. Previously, you will need to restart the daemon and the Docker client to take effect.

Now, let’s check that the insecure Docker registry is added successfully by executing docker info command. As you can see, the insecure registries list has a new entry, the docker.art-docker.com. Now we can try login. Let’s log into… docker login, using my admin user… docker.art-docker.com. And as you can see, I successfully logged in with the sub-domain method was used.

That was my video how to configure a Docker client to work with the insecure Docker registry in the repository path and the sub-domain path. Thank you for watching, and I hope you have enjoyed. Feel free to leave your comments, feedback, or questions in the comment section below.