繁体   English   中英

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

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

我通过在 Ubuntu 机器上运行的容器配置了 docker 私有注册表 (Jfrog)。 我可以从不同的主机登录到私有注册表,但是一旦我尝试在用 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

这里是 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

由于注册表不安全,我已经在 /etc/docker/daemon.json 中添加了以下代码

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

注意:如果我从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

这里是 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

有人可以帮忙吗!

因此,在工件前将 nginx 设置为反向代理后,我能够解决该问题。 可以使用以下命令直接启动此配置,如此所述

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