Artifactory主机名解析到Docker注册表

user_mda

我正在尝试将docker映像推送到Artifactory中新创建的docker存储库中。为此,我将图像标记如下,

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

然后推送图像,但出现以下错误

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

证书签名机构或主机名解析是否有问题?我检查了其他存储库是否可以与SSL证书一起很好地工作,所以我不确定问题是否出在证书上。这是我的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;
        }
    }

更新:

通过CA将证书更新为一个证书后,此错误消失了,尽管我仍然无法推送图像并得到403禁止错误。我使用的命令是

 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

码头工人客户端出现以下错误,而工件日志显示以下内容

"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"
user_mda

问题是我已经使用V1码头工人API配置了人工制品,但是试图推送支持v2 API的映像

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章