Ansible如何将本地图像推送到私人registry

我有我的服务器上的私人registry。

之后,我尝试了标签图像,并将其推向了正确的位置。

- name: Tag to repository to a private registry and push it docker_image: name: dwf/test_sample repository: registry.dwf.com/dwf/test_sample state: present 

图像dwf/test_sample是我的笔记本电脑上的本地图像。 但它试图从DockerHub:|,并收到此错误:

 "msg": "Error pulling dwf/test_sample - code: None message: Error: image dwf/test_sample not found"} 

如何使用本地图像或禁用tagpush图像时pull

请提出一个具体的解决scheme。 谢谢 !

文档中的示例( http://docs.ansible.com/ansible/docker_image_module.html )提供了一些指导:

 - name: Push image to registry docker_image: name: test_sample repository: registry.dwf.com:5000/test_sample push: yes 

为了这个工作你需要图像test_sample在你的本地docker实例。