geerlingguy / ansible-role-docker

Ansible Role - Docker
https://galaxy.ansible.com/geerlingguy/docker/
MIT License
1.81k stars 853 forks source link

Install docker compose #375

Closed craph closed 1 year ago

craph commented 2 years ago

Hello,

Just a little question about the installation of Docker Compose V2. In your role, you specify both method I guess to install Docker Compose V2. The first one with docker-compose-plugin package that is the best way to proceed if we follow the documentation and another method with the binary files in your docker-compose.yml.

Why both method ?

More over, in your docker-compose.yml you have defined the docker-compose path to : /usr/local/bin/docker-compose But in the documentation the correct path are : https://github.com/docker/compose#linux

Linux
You can download Docker Compose binaries from the [release page](https://github.com/docker/compose/releases) on this repository.

Rename the relevant binary for your OS to docker-compose and copy it to $HOME/.docker/cli-plugins

Or copy it into one of these folders to install it system-wide:

/usr/local/lib/docker/cli-plugins OR /usr/local/libexec/docker/cli-plugins
/usr/lib/docker/cli-plugins OR /usr/libexec/docker/cli-plugins
(might require making the downloaded file executable with chmod +x)

Thank you for helping me to understand why you defined both method in your role

geerlingguy commented 1 year ago

The old method is still there because many people are still running servers using the pip-installed version of docker-compose. I will be changing the default soon, though—see https://github.com/geerlingguy/ansible-role-docker/pull/369