2

docker run -d -p 5000 -v /tmp/registry:/tmp/registry --name="docker-registry" registry

docker push <docker-registry-ip>:5000/ubuntu

Resulting in the error: FATA[0000] Error: v1 ping attempt failed with error: Get http://<docker-registry-ip>:5000/v1/_ping: dial tcp <docker-registry-ip>:5000: connection refused

I have already added below to /etc/default/docker and restarted docker service DOCKER_OPTS="$DOCKER_OPTS --insecure-registry=<docker-registry-ip>:5000"

4

1 回答 1

0

您没有绑定主机上的端口。当你只提到 -p 5000 时,它是针对容器端口的,并且绑定到主机上的随机端口。您将需要运行:

docker run -d -p 5000:5000 -v /tmp/registry:/tmp/registry --name="docker-registry" registry

也不要忘记在推送之前先标记图像:

docker tag Ubuntu <docker-registry-ip>:5000/ubuntu
于 2015-04-08T22:09:25.817 回答