# Docker issues

**URL:** <https://forum.ansible.com/t/docker-issues/16441>\
**Category:** Ansible Project\
**Created:** [October 6, 2014, 1:27pm UTC](https://forum.ansible.com/t/docker-issues/16441 "2014-10-06T13:27:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![techblog](https://avatars.discourse-cdn.com/v4/letter/t/bb73d2/32.png) [@techblog](https://forum.ansible.com/u/techblog)\
**Post date:** [October 6, 2014, 1:27pm UTC](https://forum.ansible.com/t/docker-issues/16441/1 "2014-10-06T13:27:16Z")

</div>

Hello,

I’m running into issues with the docker module on ansible 1.7.2 (I also tried to 1.8). I’m trying to use docker on a VM I have provisioned in EC2. The relevant part of my playbook looks like this:

- hosts: daas\_daas\_management  
user: ec2-user  
sudo: yes  
tasks:

- name: Install docker  
yum: name=docker state=latest

- name: Install docker python  
command: easy\_install pip

- command: pip install docker-py

- name: Start the docker service  
service: name=docker state=started

- name: Login to docker  
command: docker login --email=“xxxxx” --username=“xxxxx” --password=“xxxxx”

- name: Start the mongo service  
docker: image=mongo ports=27017:27017 name=db state=restarted

Without pip messing about I get errors related to docker.client. With these present the error I get is this:

TASK: [Start the mongo service] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

failed: [54.172.106.43] =\> {“failed”: true, “parsed”: false}

SUDO-SUCCESS-ifunupbpiebrbehdtnzjnxkysxohzizh

Traceback (most recent call last):

File “/home/ec2-user/.ansible/tmp/ansible-tmp-1412601522.36-141448805312079/docker”, line 342, in

from docker.client import APIError as DockerAPIError

File “/usr/lib/python2.6/site-packages/docker/ **init**.py”, line 20, in

from .client import Client # flake8: noqa

File “/usr/lib/python2.6/site-packages/docker/client.py”, line 30, in

from . import errors

ImportError: cannot import name errors

So everything works well until I want to try docker commands. I don’t really want to run the commands locally, although I suppose that is an option if all else fails.

Can anyone help?

Thanks

andy

---

<div class="post-metadata">

**Author:** ![techblog](https://avatars.discourse-cdn.com/v4/letter/t/bb73d2/32.png) [@techblog](https://forum.ansible.com/u/techblog)\
**Post date:** [October 8, 2014, 8:41am UTC](https://forum.ansible.com/t/docker-issues/16441/2 "2014-10-08T08:41:14Z")

</div>

I resolved this in case anyone is interested. It’s a bug in docker-py (and possibly a conflict with the Amazon AMI) whereby the python six module needs to be upgraded for things to work.

andy

---

<div class="post-metadata">

**Author:** ![Neo\_Nix](https://avatars.discourse-cdn.com/v4/letter/n/82dd89/32.png) [@Neo\_Nix](https://forum.ansible.com/u/Neo_Nix)\
**Post date:** [September 24, 2015, 10:46pm UTC](https://forum.ansible.com/t/docker-issues/16441/3 "2015-09-24T22:46:21Z")

</div>

Hi Andy,

Can you give me a bit more details on how this was done?
