Centos7 docker-py 好像没有安装 [英] Centos7 docker-py doesn't seem to be installed

查看:41
本文介绍了Centos7 docker-py 好像没有安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了最小的 Centos7,然后:ansible、docker、pip 并使用 pip 我安装了 docker-py.

版本:
- Docker 版本 1.6.0,构建 8aae715/1.6.0
- ansible 1.9.1
- docker_py-1.2.2

例如尝试运行剧本

<前>- 名称:redis 容器码头工人:名称:myredis图片:redis状态:开始

我收到消息:docker-py 似乎没有安装,但 Ansible Docker 模块需要它.

我看不出问题.是 CentOS、docker 和 ansible 版本吗?

PS:我禁用了 firewalld 和 SELinux

有什么想法吗?谢谢

解决方案

我发现 docker-py 模块存在一些问题.在我完成它们之后,我最终得到了这个:

 - 名称:Docker-PY点:名称:{{ item }}"with_items:- 六个==1.4- docker-py==1.1.0

首先,我遇到了你的问题.解决方案是按照此处所述明确设置最新版本的 6:https://github.com/docker/docker-py/issues/344.

在那之后,我在 docker-py 1.2.2 版本中遇到了一个问题(你可能也遇到了).解决方法是指定一个旧版本,如下所述:https://github.com/ansible/ansible-模块核心/问题/1227.执行 pip uninstall docker-py 以摆脱较新的版本.

如果您不使用 ansible 来安装这些,请执行以下操作:

[sudo] pip 卸载 docker-py[sudo] pip install 6==1.4[sudo] pip install docker-py==1.1.0

I installed Centos7 minimal and then: ansible, docker, pip and using pip I installed docker-py.

Versions:
- Docker version 1.6.0, build 8aae715/1.6.0
- ansible 1.9.1
- docker_py-1.2.2

Trying to run a playbook, for example

- name: redis container
  docker:
    name: myredis
    image: redis
    state: started

i get msg: docker-py doesn't seem to be installed, but is required for the Ansible Docker module.

I can't see the problem. Is it the CentOS, docker and ansible version?

PS: I disabled the firewalld and SELinux

Any ideas? Thanks

解决方案

I found a couple problems with the docker-py module. After I worked through them I ended up with this:

  - name: Docker-PY
    pip:
      name: "{{ item }}"
    with_items:
    - six==1.4
    - docker-py==1.1.0

First, I ran into your problem. The solution is to explicitly set the most recent version of six as described here: https://github.com/docker/docker-py/issues/344.

After that, I ran into an issue (you might run into it too) with a bug in the docker-py 1.2.2 version. The workaround is to specify an older version as described here: https://github.com/ansible/ansible-modules-core/issues/1227. Do a pip uninstall docker-py to get rid of the newer version.

If you aren't using ansible to install these then do this:

[sudo] pip uninstall docker-py
[sudo] pip install six==1.4
[sudo] pip install docker-py==1.1.0

这篇关于Centos7 docker-py 好像没有安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆