简体   繁体   English

我的 docker 无法使用私有注册表(503 服务不可用)

[英]my docker cannot use private registry(503 Service Unavailable)

I want to deploy my code to the environment of production.But when I trying to run this command:我想将我的代码部署到生产环境中。但是当我尝试运行此命令时:

  docker login -u admin -p admin123 172.xxx.x.xxx:30003

it returned me "503 service unavailable".它返回给我“503 服务不可用”。 it told me "connection refused" when I curl http://172.xxx.x.xxx:30003 ,当我curl http://172.xxx.x.xxx:30003时,它告诉我“连接被拒绝”,

it's not the first time I deploy this code and this phenomenon has never arise untill last week,how can I do with this strange problem??这不是我第一次部署此代码,直到上周才出现这种现象,我该如何处理这个奇怪的问题?

1.restart docker service 2.upgrade docker desktop(with Mac system) but still the same! 1.重启docker服务 2.升级docker桌面(Mac系统)还是一样!

my daemon.json:我的守护进程.json:

{
  "insecure-registries" : [
    "172.xxx.xxx.xxx:30003",
    "127.0.0.1:5000"
  ]
}

and this is the context:这是上下文:

Yutongs-MacBook-Pro-2:~ yutong.liu$ docker login -u admin -p admin123 172.xxx.xxx.xxx:30003
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Error response from daemon: login attempt to http://172.xxx.xxx.xxx:30003/v2/ failed with status: 503 Service Unavailable

Yutongs-MacBook-Pro-2:~ yutong.liu$ curl http://172.xxx.xxx.xxx:30003/
curl: (7) Failed to connect to 172.xxx.xxx.xxx port 30003: Connection refused

Try to put the address first试着把地址放在第一位

docker login 172.xxx.x.xxx:30003 -u admin -p admin123 

The below error is a server side error,以下错误是服务器端错误,

503 Service Unavailable

Most probably your docker registry is DOWN.很可能您的 docker 注册表已关闭。

Try the following steps to root cause the issue.尝试以下步骤来解决问题的根本原因。

First check if the docker registry port is accessible or not.首先检查 docker 注册端口是否可以访问。

nc -zv 172.xxx.x.xxx 30003

If this is successful, you can try the following cURL request to list the docker registry catalog,如果这样成功,你可以尝试下面的 cURL 请求列出 docker 注册表目录,

curl http://172.xxx.x.xxx:30003/v2/_catalog

If this fails, it means your docker registry is down.如果失败,则意味着您的 docker 注册表已关闭。

Please try to confirm if the docker registry is UP or DOWN and then try again.请尝试确认 docker 注册表是 UP 还是 DOWN,然后重试。

Hope it helps.希望能帮助到你。

We have the same problem;我们有同样的问题; but the docker client in windows works.但是 windows 中的 docker 客户端可以工作。 It's when we try from a linux machine that it fails.当我们尝试使用 linux 机器时,它会失败。

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

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