How to set a Docker registry in JFrog Artifactory with a subdomain method?
Hi, my name is Ezekial Knox from JFROG Support, and in this short video I will show you how to set up Docker registries using an Nginx reverse proxy using the Subdomain Method. Let’s start.
Here is a brief overview of what we’ll be going over in today’s video, how to set up the subduing method in Artifactory UI, configuring the artifactory.com file, editing your host file to work with the Subdomain method, and Docker login/ Docker pulled demo. Next, I’ll show you how to set up the Subdomain method in the Artifactory UI. You’re going to want to navigate to Artifactory hit the administration console, click on Artifactory and then navigate to HTTP settings. Here you’ll see that you’re going to want to have your Docker access method, your Subdomain, your reverse proxy as Nginx, and for my purposes, I have my internal host name for localhost and my public server name for our art.local. This could change for your instance. I have my HTTP port set to 80 and my HTTPS port set to 443. And here is where you’re going to want your certificates to reside on your server.
Next, I’ll show you how to configure artifactory.con file. Please note in order to continue you will need a Wildcard SSL certificate signed by a trusted authority CA. An example of one is shown below. Here notice that the common name is *.art.local, this will need to be the same as your server name in Artifactory. If this is a production into it is necessary to set up a Wildcard DNS record to allow the Subdomain Method. An example of a Wildcard DNS record would be like shown here, *.art.local. I will emulate this later in my Etsy host file, but then again, the process is on a test environment and not production, so it will be different for your environment. Typically when entering this folder, there’ll be a default file here, but I’ve already removed it. So you can do so as well and create your artifactory.com file.
Next, we’re going to want to head back to Artifactory go to our HTTP settings and download our artifactory configuration. After it’s downloaded, please open the file and copy its contents and paste them in your Artifactory comp file as such. Next, I want to edit my Etsy host file. Here you’ll see that I’ve added all of the Docker hosts that I want to log in with the under localhost. Now this will be different for production environment because you will not want to edit it on your personal Etsy host file, but the concept is still the same. You want to make the host available so that your server can access them.
Now that everything’s configured, all we have to do is log in, and we’re in. And now that we’re logged, I’ll perform a Docker pull, you do so with the following Docker pull, and I’ll do it with docker.art.local since that’s what I logged in with. And we’ll be pulling the image Nginx. Now that the pull is complete, we will be able to see it in our Artifactory instance, just head over to Artifactory, artifacts, and we will go to our Docker remote, and here it is.
Next, we’ll need to perform a Docker push, but first, we will need to pull the image locally that we want to use. So I will pull the centos image. So, now we’re going to want to tag the image, so you can do so by doing Docker tags, docker.art.local with the tag c2. Now we want to do a Docker push. Now that the image has been tagged we can push it to Artifactory with the command Docker push, docker.art.local/centos with our tag c2. Now we can see an Artifactory when we refresh our repository, it should be there. And here it is. And that was my video on configuring your Docker registries to work with your Nginx reverse proxy on the Subdomain method. Thanks for watching, and I hope you enjoy it. Feel free to leave your comments, feedback, or questions in the comment section below.