简体   繁体   English

带有工件的Docker推送

[英]Docker push with artifactory

I am trying to create a local docker repository where I can push my images into.For this I have done the following steps 我正在尝试创建一个本地docker存储库,可以将映像推送到其中。为此,我完成了以下步骤

Configured nginx with SSL Configured nginx so that it binds the docker local repo with the server name Following is my nginx configuration 使用SSL配置的nginx配置的nginx,使其与服务器名称绑定docker本地存储库以下是我的nginx配置

upstream artifactory_lb {
        server myLb.company.com:8081;
        server myLb.company.com:8081 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 myLb.company.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;
    }
}

When I try to push a docker image - docker push https://myLb.comapny.com/docker/api/image_name I get the following error 当我尝试推送docker映像docker push https://myLb.comapny.com/docker/api/image_name ,出现以下错误

v2 ping attempt failed with error: Get https://myLb.company.com/v2/: x509: certificate signed by unknown authority

Note: I did check the authority of the certificate and the other repositories in artifactory work with no issues 注意:我确实检查了证书和其他存储库在人工工作中的权限,没有任何问题

Also installed the certificate under /etc/docker/certs.d and etc/ssl/ca-certificates and usr/local/share/ca-certificates 还将证书安装在/etc/docker/certs.d和etc / ssl / ca-certificates和usr / local / share / ca-certificates下

What am I missing? 我想念什么?

You may be missing the certificate chain from the Nginx config. 您可能会从Nginx配置中丢失证书链。

See: http://nginx.org/en/docs/http/configuring_https_servers.html#chains 请参阅: http : //nginx.org/en/docs/http/configuring_https_servers.html#chains

How you get this chain certificate (intermediate certificate) depends on your certificate authority. 如何获得此链式证书(中间证书)取决于您的证书颁发机构。 You should be able to find it via your CA instructions. 您应该能够通过CA指导找到它。 For example, for GoDaddy, the instructions point you towards this repository where you can find the intermediate certificate chain: https://certs.godaddy.com/repository 例如,对于GoDaddy, 说明将您定向到该存储库,您可以在其中找到中间证书链: https : //certs.godaddy.com/repository

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM