Installing docker-compose-plugin on amazon linux 2

Viewed 954

I'm trying to install docker-compose-plugin onto Amazon Linux 2, so that "docker compose" acts more like "docker-compose" would. [As I understand, the latter is deprecated] I can't find any instructions and the obvious approach (treat it like Centos 7) does not work at all - the basic way docker is installed on Amazon Linux 2 is very different.

Does anybody know?

2 Answers

I did find the answer to this, or at least one that works seemingly well:

  • Look at the plugin repo https://github.com/docker/compose and find the latest release (assuming you want up to date)
  • Copy the URL for docker-compose-linux-x86_64
  • Go to the machine and do "curl -L -o docker-compose URL", replace URL as appropriate
  • chmod a+x docker-compose
  • sudo mv docker-compose /usr/libexec/docker/cli-plugins/

If you do "docker compose help" it should look like docker-compose used to output.

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
Related