首页 > 解决方案 > Ansible-container push/deploy failure; cant push images to dockerhub

问题描述

I am trying to push an image built with ansible-container to my registry in Dockerhub.I have pushed to this same image to the same registry using just docker so I am pretty sure it has nothing to do with my local version of docker or with Dockerhub.

The command I run to push the image is:

ansible-container push --username zacharius --password $PASS --push-to https://hub.docker.com/

and I get a timeout message:

container.exceptions.AnsibleContainerConductorException: Error logging into registry: 500 Server Error: Internal Server Error ("Get https://hub.docker.com/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)")

I have been pulling my hair out trying to get ansible-container and Dockerhub to talk to each other and any assistance would be greatly appreciated

标签: dockeransibleansible-container

解决方案


好的,所以我发现我的问题在于假设我的 docker 注册表的 url 与我用来从浏览器查看注册表的 url 相同。我想要的实际注册表是 docker.io。我还需要在网址末尾包含我的用户名。所以正确的命令是:

ansible-container push --username zacharius --password $PASS --push-to https://docker.io/zacharius

为将来有类似问题的人发布此答案。我只在别人的代码示例中看到了 docker.io,否则我不确定我应该如何知道这是正确的 url


推荐阅读