Here is a bash script to install latest docker compose plugin for all users on amazon linux 2:
sudo mkdir -p /usr/local/lib/docker/cli-plugins/
sudo curl -SL https://github.com/docker/compose/releases/latest/download/docker-compose-linux-x86_64 -o /usr/local/lib/docker/cli-plugins/docker-compose
sudo chmod +x /usr/local/lib/docker/cli-plugins/docker-compose
Answer from gennadi.eckstein on Stack OverflowHere is a bash script to install latest docker compose plugin for all users on amazon linux 2:
sudo mkdir -p /usr/local/lib/docker/cli-plugins/
sudo curl -SL https://github.com/docker/compose/releases/latest/download/docker-compose-linux-x86_64 -o /usr/local/lib/docker/cli-plugins/docker-compose
sudo chmod +x /usr/local/lib/docker/cli-plugins/docker-compose
if you want docker compose v2 or docker compose plugin, just run below.
(note: suit for CentOS7orAmazon Linuxoramzn)
sudo curl -L https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-compose-plugin-2.6.0-3.el7.x86_64.rpm -o ./compose-plugin.rpm
sudo yum install ./compose-plugin.rpm -y
more package, see https://download.docker.com/linux/
How to install docker-compose v2 on Linux
Is it possible to install Docker Compose in Amazon Linux 2023 using package manager?
Troubleshooting Docker-Compose Installation on CentOS 7: libz.so.1 Error
Adding yum install inside docker-compose yaml file
Videos
On Amazon Linux 2023 the global cli-plugins directory for Docker is /usr/libexec/docker/cli-plugins/. So...
# download the latest version in the global plugins directory
sudo curl -SL https://github.com/docker/compose/releases/latest/download/docker-compose-linux-$(uname -m) -o /usr/libexec/docker/cli-plugins/docker-compose
# make it executable
sudo chmod +x /usr/libexec/docker/cli-plugins/docker-compose
# check
docker compose version
I looked around for a while before finally tracking this down.
It's here for anyone who finds themselves in the same boat.
The plugin was not installed along with docker. Here is a one-liner:
Edited:
sudo curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-linux-$(uname -m) -o /usr/bin/docker-compose && sudo chmod 755 /usr/bin/docker-compose && docker-compose --version
I looked this up but I can't find a way to install it using the package manager 'yum'.as indicated in the installation instructions here - "https://docs.docker.com/compose/install/linux/"
It just says that there is no match for 'docker-compose'plugin'
This is my preferred way to install it if possible. Maybe I have to add some repository so it can locate it? but I don't know how.
EDIT: to be more specific, I'm using docker that is installed part of Amazon Linux 2023 on a Lightsail instance, I did not install it myself - package version (docker-25.0.14-1.amzn2023.0.1.x86_64). Also there is no docker compose plug in that came with it as I checked that already.