连接在推送Docker映像时被拒绝 [英] Connection refused on pushing a docker image

查看:896
本文介绍了连接在推送Docker映像时被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将通过遵循 https://docs.docker.com/来设置本地注册表注册表/部署/

 docker run -d -p 5000:5000 --restart=always --name reg ubuntu:16.04

当我尝试运行以下命令时:

When I try to run the following command:

$ docker push localhost:5000/my-ubuntu

我得到错误:

Get http://localhost:5000/v2/: dial tcp 127.0.0.1:5000: connect:connection refused

有什么想法吗?

推荐答案

连接被拒绝通常意味着您要连接的服务实际上并未像应有的那样正常运行。 问题中概述的其他原因,但就您的情况而言,从本质上讲,这仅意味着注册表尚未启动。

Connection refused usually means that the service you are trying to connect to isn't actually up and running like it should. There could be other reasons as outlined in this question, but essentially, for your case, it simply means that the registry is not up yet.

请等待执行其他操作之前正确创建注册表容器- docker run -d -p 5000:5000 --restart = always --name注册表注册表:2 官方docker映像

Wait for the registry container to be created properly before you do anything else - docker run -d -p 5000:5000 --restart=always --name registry registry:2 that creates a local registry from the official docker image.

请确保 registry 容器通过运行 docker ps |启动。 grep登录,然后继续进行操作。

Make sure that the registry container is up by running docker ps | grep registry, and then proceed further.

这篇关于连接在推送Docker映像时被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆