Deploying a Docker image to Artifactory with Self-Signed SSL Certificates

If you are following along with a different package type, this shouldn’t be much different
$ sudo apt-get install nginx
###########################################################
## this configuration was generated by JFrog Artifactory ##
###########################################################
## add ssl entries when https has been set in config
ssl_certificate /etc/nginx/certs/domain.crt;
ssl_certificate_key /etc/nginx/certs/domain.key;
ssl_session_cache shared:SSL:1m;
## ssl_prefer_server_ciphers on;
## server configuration
server {
listen 443 ssl;
listen 80 ;
server_name ~(?<repo>.+)\.my-wildcard-subdomain my-wildcard-subdomain;
if ($http_x_forwarded_proto = '') {
set $http_x_forwarded_proto $scheme;
}
## Application specific logs
## access_log /var/log/nginx/my-wildcard-subdomain-access.log timing;
## error_log /var/log/nginx/my-wildcard-subdomain-error.log;
rewrite ^/$ /artifactory/webapp/ redirect;
rewrite ^/artifactory/?(/webapp)?$ /artifactory/webapp/ redirect;
rewrite ^/(v1|v2)/(.*) /artifactory/api/docker/$repo/$1/$2;
chunked_transfer_encoding on;
client_max_body_size 0;
location /artifactory/ {
proxy_read_timeout 900;
proxy_pass_header Server;
proxy_cookie_path ~*^/.* /;
if ( $request_uri ~ ^/artifactory/(.*)$ ) {
proxy_pass http://localhost:8082/artifactory/$1;
}
proxy_pass http://localhost:8082/artifactory/;
proxy_set_header X-Artifactory-Override-Base-Url $http_x_forwarded_proto://$host:$server_port/artifactory;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
{
"insecure-registries":["docker.my-wildcard-subdomain","docker-local.my-wildcard-subdomain", "docker-remote.my-wildcard-subdomain"]
}
$ docker pull docker.my-wildcard-subdomain/hello-world:latest
latest: Pulling from hello-world
9a0669468bf7: Pull complete
Digest: sha256:c39f10a159696100a2c30a9ecbdc927363613664d65dff5b928291440f75a76b
Status: Downloaded newer image for docker.my-wildcard-subdomain/hello-world:latest

--

--

--

Python Coder — DevOps Padawan — Total Nerd

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Standardization = Self-Service

Hello world to Azure Databricks with Terraform

Reduce the number of inflation of ViewHolders drastically by sharing a ViewPool across multiple…

LINUX WORLD / SUMMER TRAINING 2021

Dev of the day, or not, that is the question

Orgzit Features That Triple Team Productivity

Builder Design Pattern

FileMaker 17 — Why I Don’t Care About 17, But Love the FileMaker Platform

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Angello Maggio

Angello Maggio

Python Coder — DevOps Padawan — Total Nerd

More from Medium

Docker inside Docker

Https implementation on apache ubuntu with let’s encrypt

Secure your traefik dashboard with HTTPS and Basic Auth