Artifactory host name resolution on docker registry

I'm trying to push the docker image into a newly created docker rehearsal in Artifactory. To do this, I mark the image as follows:

docker tag ubuntu mNginxLb.mycompany.com/artifactory/api/docker/<repo_key>

and then click the image but get the following error

docker push  mNginxLb.mycompany.com/artifactory/api/docker/<repo_key>/ubuntu

The push refers to a repository [mNginxLb.mycompany.com/artifactory/api/docker/<repo_key>/ubuntu] (len: 1)
unable to ping registry endpoint https://mNginxLb.mycompany.com/v0/
v2 ping attempt failed with error: Get https://mNginxLb.mycompany.com/v2/: x509: certificate signed by unknown authority
 v1 ping attempt failed with error: Get https://mNginxLb.mycompany.com/v1/_ping: x509: certificate signed by unknown authority

Is this a problem with certificate signing authority or with host name resolution? I checked if other repositories work with SSL certificate, so I'm not sure if the problem is with certificates. Here is my nginx conf:

upstream artifactory_lb {
            server mNginxLb.mycompany.com:8081;
            server mNginxLb.mycompany.com backup;
    }

    log_format upstreamlog '[$time_local] $remote_addr - $remote_user - $server_name  to: $upstream_addr: $request upstream_response_time $upstream_response_time msec $msec request_time $request_time';

    server {
            listen 80;
            listen 443 ssl;

            ssl_certificate  /etc/nginx/ssl/my-certs/myCert.pem;
            ssl_certificate_key /etc/nginx/ssl/my-certs/myserver.key;
            client_max_body_size 2048M;
            location / {
                    proxy_set_header Host $host:$server_port;
                    proxy_pass http://artifactory_lb;
                    proxy_read_timeout 90;
            }
            access_log /var/log/nginx/access.log upstreamlog;
            location /basic_status {
                    stub_status on;
                    allow all;
                    }
    }

    # Server configuration

    server {
        listen 2222 ssl;

        server_name mNginxLb.mycompany.com;
        if ($http_x_forwarded_proto = '') {
            set $http_x_forwarded_proto  $scheme;
        }

        rewrite ^/(v1|v2)/(.*) /api/docker/my_local_repo_key/$1/$2;
        client_max_body_size 0;
        chunked_transfer_encoding on;
        location / {
        proxy_read_timeout  900;
        proxy_pass_header   Server;
        proxy_cookie_path ~*^/.* /;
        proxy_pass         http://artifactory_lb;
        proxy_set_header   X-Artifactory-Override-Base-Url $http_x_forwarded_proto://$host;
        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;
        }
    }

UPDATE:

After updating the certificate to CA, this error disappears, although I still can’t click the images and get the forbidden error 403. The command I use

 docker push host:port/The push refers to a repository [host:port/image_name] (len: 1)
Sending image list
Error: Status 403 trying to push repository ubuntu: "<!DOCTYPE html><html><head><title>Apache Tomcat/8.0.22 - Error report</title><style type=\"text/css\">H1 {f
ont-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#5
25D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;c
olor:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;backgro
und:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}.line {height: 1px; background-color: #525D76; border: none;}</style> </head><bod
y><h1>HTTP Status 403 - </h1><div class=\"line\"></div><p><b>type</b> Status report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>Access to the speci
fied resource has been forbidden.</u></p><hr class=\"line\"><h3>Apache Tomcat/8.0.22</h3></body></html>"image_name

The docker client gives the following error While the art magazines show the following

"GET /v2/ HTTP/1.1" 404 466 "-" "docker/1.9.1 go/go1.4.2 git-commit/a34a1d5 kernel/3.13.0-24-generic os/linux arch/amd64"
172.28.144.202 - - [22/Dec/2015:11:06:00 -0500] "GET /v2/ HTTP/1.1" 404 466 "-" "docker/1.9.1 go/go1.4.2 git-commit/a34a1d5 kernel/3.13.0-24-generic os/linux arch/amd64"
 "GET /v1/_ping HTTP/1.1" 404 470 "-" "docker/1.9.1 go/go1.4.2 git-commit/a34a1d5 kernel/3.13.0-24-generic ] "PUT /v1/repositories/ubuntu/ HTTP/1.1" 403 449 "-" "docker/1.9.1 go/go1.4.2 git-commit/a34a1d5 kernel/3.13.0-24-generic os/linux arch/amd64"
+4
2

, artifactory API- V1, , API v2

0

Docker ( ) . , (2222) . .

:

docker tag ubuntu mNginxLb.mycompany.com:2222/ubuntu

docker push mNginxLb.mycompany.com:2222/ubuntu

, latest . :

docker tag ubuntu:15.10 mNginxLb.mycompany.com:2222/ubuntu:15.10

+1

Source: https://habr.com/ru/post/1620161/


All Articles