我目前正在尝试将nexus3配置为docker映像的私有注册表,并将nginx用作反向代理。在关联内创建了3个存储库,分别是NexusDockerProxy(docker代理),NexusDockerHosted(docker托管,http端口:4444)和NexusDockerGroup(docker组,http端口:5555),同时添加了托管和代理。
nexus是使用nginx配置的,其中我们正在使用自签名证书,并将其添加到nginx配置文件中。
server { proxy_send_timeout 120; proxy_read_timeout 300; proxy_buffering off; tcp_nodelay on; server_tokens off; client_max_body_size 1G; listen 80; server_name server908.int.org.com; location / { rewrite ^(.*) https://server908.int.org.com$1 permanent; } } server { listen 443; server_name server908.int.org.com; keepalive_timeout 60; ssl on; ssl_certificate /etc/ssl/certs/orgnexus.crt; ssl_certificate_key /etc/ssl/certs/orgnexus.key; ssl_ciphers HIGH:!kEDH:!ADH:!MD5:@STRENGTH; ssl_session_cache shared:TLSSSL:16m; ssl_session_timeout 10m; ssl_prefer_server_ciphers on; location / { proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto "https"; proxy_pass http://server908.int.org.com:8082; proxy_read_timeout 90; } } # correlates to your nexus http connector server { listen 6666; server_name server908.int.org.com; keepalive_timeout 60; ssl on; ssl_certificate /etc/ssl/certs/orgnexus.crt; ssl_certificate_key /etc/ssl/certs/orgnexus.key; ssl_ciphers HIGH:!kEDH:!ADH:!MD5:@STRENGTH; ssl_session_cache shared:TLSSSL:16m; ssl_session_timeout 10m; ssl_prefer_server_ciphers on; client_max_body_size 1G; chunked_transfer_encoding on; location / { access_log /var/log/nginx/docker.log; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto "https"; proxy_pass http://server908.int.org.com:5555; proxy_read_timeout 90; } }
我们在下面的条目“ / etc / default / docker”文件中添加了注释。
http_proxy=http://x.x.x.x:3128 https_proxy=http://x.x.x.x:3128
登录也成功
[root@server446 ~]$ docker login -u admin -p admin123 server908.int.org.com:6666 Login Succeeded
搜索并提取图像也可以。
[test@server446 ~]$ docker search server908.int.org.com:6666/mac INDEX NAME DESCRIPTION STARS OFFICIAL AUTOMATED org.com server908.int.org.com:6666/crate CrateDB is a distributed SQL database hand... 79 [OK] org.com server908.int.org.com:6666/maccam912/meanjs MEANJS (not MEANIO) starting point for dev... 27 [OK] org.com server908.int.org.com:6666/macadmins/puppetmaster Simple puppetmaster based on CentOS 6 25 [OK] org.com server908.int.org.com:6666/macadmins/bsdpy Apple NetBoot replacement written in Pytho... 18 [OK] org.com server908.int.org.com:6666/macadmins/reposado Host Apple Software Updates from a Docker ... 12 [OK] org.com server908.int.org.com:6666/mackerel/mackerel-agent 11 [OK] org.com server908.int.org.com:6666/macadmins/munkiwebadmin This Docker container runs MunkiWebAdmin. ... 8 [OK] org.com server908.int.org.com:6666/macadmins/postgres Postgres that accepts remote connections b... 8 [OK] org.com server908.int.org.com:6666/macropin/strider Possibly the best `Dockerfile` for Strider-CD 8 [OK] org.com server908.int.org.com:6666/mace/openvpn-as OpenVPN Access-Server with WebUI 7 [OK] org.com server908.int.org.com:6666/frolvlad/alpine-python-machinelearning Small Docker image with Python Machine Lea... 6 [OK] org.com server908.int.org.com:6666/macadmins/munkireport-php Docker autobuild repository for https://re... 6 [OK] org.com server908.int.org.com:6666/mace/qbittorrent qBittorrent build from source 6 [OK] org.com server908.int.org.com:6666/macropin/sshd (deprecated) Use docker.io/panubo/sshd 5 [OK] org.com server908.int.org.com:6666/macadmins/macnamer 4 [OK] org.com server908.int.org.com:6666/macadmins/puppetmaster-whdcli Puppetmaster + WHDCLI for autosigning base... 4 [OK] org.com server908.int.org.com:6666/macadmins/sal An image that runs [Sal](https://github.co... 4 [OK] org.com server908.int.org.com:6666/macropin/roundcube Docker container for Roundcube webmail 4 [OK] org.com server908.int.org.com:6666/uetchy/machinelearning Dockerfile for scientists studying Machine... 4 [OK] org.com server908.int.org.com:6666/clearlinux/machine-learning Machine Learning Container 3 [OK] org.com server908.int.org.com:6666/hartator/wayback-machine-downloader Download an entire archive from the Waybac... 3 [OK] org.com server908.int.org.com:6666/macadmins/whd Docker container for SolarWinds WebHelpDesk 3 [OK] org.com server908.int.org.com:6666/macinv/gunicorn-example A simple Gunicorn example 2 [OK] org.com server908.int.org.com:6666/macropin/mailman Mailman all in one container 2 [OK] org.com server908.int.org.com:6666/spacemacs/emacs25 Spacemacs running on Emacs 25. 2 [OK]
[test@server446 ~]$ docker pull server908.int.org.com:6666/macadmins/puppetmaster Using default tag: latest Trying to pull repository server908.int.org.com:6666/macadmins/puppetmaster ... sha256:bf7a53a0ddb6cd0371cfec3fe6131347b5a3712c2cf282400c979ed254a38f67: Pulling from server908.int.org.com:6666/macadmins/puppetmaster 0d399614d56a: Pull complete 75e4c6031170: Pull complete 12a00ed15a39: Pull complete 6fb754ec65e3: Pull complete 9b6cf7664f02: Pull complete 07db30a930a5: Pull complete ccdd2cf9b303: Pull complete 820dfdfc6db7: Pull complete 78c5dec8ba5d: Pull complete Digest: sha256:bf7a53a0ddb6cd0371cfec3fe6131347b5a3712c2cf282400c979ed254a38f67 Status: Downloaded newer image for server908.int.org.com:6666/macadmins/puppetmaster:latest
但是,在推送图像时,出现以下404错误。
[test@server446 ~]$ docker push server908.int.org.com:6666/maven:1 The push refers to a repository [server908.int.org.com:6666/maven] 701925f78142: Layer already exists 78bb4fee972f: Layer already exists e1300844f726: Layer already exists bfee0515af91: Preparing 2afcf4c557eb: Preparing 72cfa243711c: Waiting 9bf603e17b04: Waiting 70b22baddf90: Waiting 596ecbaf3ba4: Waiting 445ed6ee6867: Waiting c59fa6cbcbd9: Waiting 8d4d1ab5ff74: Waiting error parsing HTTP 404 response body: invalid character '<' looking for beginning of value:
我确实试图使它起作用,但是现在停留在最后一步。感谢帮助docker push工作的任何帮助。