我正在尝试使用 ansible 在本地构建 docker 映像,但遇到了问题。
- hosts: all
tasks:
- name: Build Docker image
local_action:
module: docker_image
path: .
name: SlothSloth
state: present
我的 /etc/ansible/hosts 包含
localhost ansible_connection=local
但是当我尝试运行它时,我得到:
TASK: [Build Docker image] ****************************************************
failed: [localhost -> 127.0.0.1] => {"failed": true, "parsed": false}
failed=True msg='failed to import python module: No module named docker.client'
FATAL: all hosts have already failed -- aborting