简体   繁体   English

能够登录到 docker 私有注册表,但无法将图像推送到它

[英]Able to login to docker private registry but can't push the image to it

I have configured a docker private registry (Jfrog) through a container running on an Ubuntu machine.我通过在 Ubuntu 机器上运行的容器配置了 docker 私有注册表 (Jfrog)。 I am able to login to private registry from different host , but as soon as I try to push an image after tagging it with repo name I am getting below error.我可以从不同的主机登录到私有注册表,但是一旦我尝试在用 repo 名称标记图像后推送图像,我就会遇到错误。

sudo docker pull alpine

sudo docker tag alpine docker.artifactory:8081/alpine:1.0

sudo docker push docker.artifactory:8081/alpine:1.0
The push refers to repository [docker.artifactory:8081/alpine]
77cae8ab23bf: Pushing [==================================================>]  5.553MB/5.553MB
http: server gave HTTP response to HTTPS client

Here is docker login output这里是 docker 登录 output

sudo docker login docker.artifactory:8081
Authenticating with existing credentials...different host
WARNING! Your password will be stored unencrypted in /home/rahul/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded

Since the registry is insecure I have already added below code in /etc/docker/daemon.json由于注册表不安全,我已经在 /etc/docker/daemon.json 中添加了以下代码

{
        "insecure-registries":["docker-local.artifactory:8081", "docker.artifactory:8081", "docker-remote.artifactory:8081"]
}

Note: If I pull an image from docker-remote.artifactory:8081 and then tag it to docker.artifactory:8081 , I can push the image without any issues注意:如果我从docker-remote.artifactory:8081拉取图像,然后将其标记为docker.artifactory:8081 ,我可以毫无问题地推送图像

sudo docker pull docker-remote.artifactory:8081/alpine
sudo docker tag alpine docker.artifactory:8081/alpine:1.0

Here is docker version output这里是 docker 版本 output

sudo docker version
Client:
 Version:           18.09.7
 API version:       1.39
 Go version:        go1.10.4
 Git commit:        2d0083d
 Built:             Fri Aug 16 14:19:38 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Server:
 Engine:
  Version:          18.09.7
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.4
  Git commit:       2d0083d
  Built:            Thu Aug 15 15:12:41 2019
  OS/Arch:          linux/amd64
  Experimental:     false

can someone help!有人可以帮忙吗!

So, I was able to resolve the issue after setting nginx as a reverse proxy in front of artifactory.因此,在工件前将 nginx 设置为反向代理后,我能够解决该问题。 This configuration can be directly spin up with below command as mentioned in here可以使用以下命令直接启动此配置,如此所述

curl https://jfrog.bintray.com/run/art-compose/latest/art-compose | sudo bash

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

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