Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Can';t使用ansible和community.general.docker_image提取docker映像_Docker_Ansible - Fatal编程技术网

Can';t使用ansible和community.general.docker_image提取docker映像

Can';t使用ansible和community.general.docker_image提取docker映像,docker,ansible,Docker,Ansible,在ansible剧本中,我尝试提取一个图像,并重新标记它: docker pull hyperledger/fabric-ccenv:amd64-1.4.4 docker tag hyperledger/fabric-ccenv:amd64-1.4.4 hyperledger/fabric-ccenv:latest 我甚至都拉不动它 我使用社区.general.docker\u image来实现这一点: ansible-galaxy collection install community.g

在ansible剧本中,我尝试提取一个图像,并重新标记它:

docker pull hyperledger/fabric-ccenv:amd64-1.4.4
docker tag hyperledger/fabric-ccenv:amd64-1.4.4 hyperledger/fabric-ccenv:latest
我甚至都拉不动它

我使用社区.general.docker\u image来实现这一点:

ansible-galaxy collection install community.general
然后是我的剧本:

---
- name: Pull an image
  hosts: nodes
  become: true
  community.general.docker_image:
    name: hyperledger/fabric-ccenv:amd64-1.4.4
    source: pull
并与:

ansible-playbook install-dependencies.yml
我得到这个错误:

ERROR! 'community.general.docker_image' is not a valid attribute for a Play

The error appears to be in 'install-dependencies.yml': line 2, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

---
- name: Pull an image
  ^ here

我做错了什么?

您的剧本中缺少了任务选项:

---
- name: Pull an image
  hosts: nodes
  become: true
  community.general.docker_image:
    name: hyperledger/fabric-ccenv:amd64-1.4.4
    source: pull


您使用的是哪个版本的ansible
ansible——版本
ansible 2.10.4,python版本=3.8.5ah当然,很抱歉没有注意到,您的剧本中缺少任务选项