angstwad/docker.ubuntu

Getting error when trying to run `docker-compose` on Ubuntu 16.04

Closed this issue · 7 comments

One a fresh Ubuntu 16.04 VM, after installing Docker via this role (with all defaults), I'm getting:

$ docker-compose up 
ERROR: Dependency conflict: an older version of the 'docker-py' package is polluting the namespace. Run the following command to remedy the issue:
pip uninstall docker docker-py; pip install docker

See related issue in the SaltStack queue: saltstack/salt#39216

And as an aside, simply running sudo pip uninstall docker docker-py; sudo pip install docker (or running as root user instead of using sudo) fixes the problem—afterwards, docker-compose up (as long as your user is in the docker group!) works correctly.

I just noticed the pip_install_docker_py variable... that might be all I need.

Confirmed, this worked for me:

-
   hosts: all
   remote_user: vagrant
   sudo: true
   roles:
     - role: angstwad.docker_ubuntu
       docker_group_members: [ "{{ remote_user }}" ]
       pip_install_docker_py: false
vagrant@vagrant-ubuntu-trusty-64:~$ docker-compose --version
docker-compose version 1.11.0, build 6de1806
vagrant@vagrant-ubuntu-trusty-64:~$ docker --version
Docker version 1.13.1, build 092cba3

So based on your experience here, should I default to not installing docker-py on 16.04?

@angstwad - Yeah, that looks to be the fix!

@angstwad This fixes docker-compose, but breaks docker_container on Ansible tip.