followed the link to install the docker-compose link
Basically, thee are only two steps as below:
Copysudo curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose version
Answer from Santosh Garole on Stack Overflowfollowed the link to install the docker-compose link
Basically, thee are only two steps as below:
Copysudo curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose version
You can start from the scratch on Amazon Linux ec2 instance for installing Docker by following the step:
Copysudo yum update -y
sudo amazon-linux-extras install docker
sudo yum install docker
sudo service docker start
sudo usermod -a -G docker ec2-user
Then logout from the instance and login again to verify the installation of Docker
Copydocker info
To install Docker-compose follow the below steps:
Copysudo curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose version
Q: Installing docker-compose on Amazon EC2 Linux 2
Rather than dynamically looking up the OS type, just specify the linux version...
sudo curl -L https://github.com/docker/compose/releases/download/1.26.2/docker-compose-Linux-x86_64" -o /usr/local/bin/docker-composeMore on reddit.com
Updating docker engine and docker compose plugin in Amazon Linux 2?
Install docker compose v2 on aws linux 2 - Stack Overflow
EC2 with docker services
Videos
Hi,
First of all, let me state I'm not the most virtuous of Linux users, so bare with me...
Below is a brief run-down of all the steps I took. Ultimately the question/issue is is that it seems impossible for me to get a proper docker-compose installation downloaded.
-
Followed instructions to install docker https://docs.aws.amazon.com/AmazonECS/latest/developerguide/docker-basics.html
-
sudo curl -L "https://github.com/docker/compose/releases/download/1.26.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
Tried 4 variations of the above command to try to install docker-compose. As shown in the URLs below.
https://www.codegrepper.com/code-examples/php/how+to+install+docker+compose+in+ec2
https://portal.cloud303.io/forum/aws-1/question/i-want-to-install-docker-compose-on-an-amazon-linux-2-ec2-instance-9
https://acloudxpert.com/how-to-install-docker-compose-on-amazon
https://gist.github.com/npearce/6f3c7826c7499587f00957fee62f8ee9
When typing "docker-compose", "sudo docker-compose" etc. All it will say is
"Line 1: Not: command not found".
It seems to be the issue that the docker-compose file is only 9kb in size. Because this is what I get back every time I use the above mentioned docker-compose install sequences.
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 9 100 9 0 0 58 0 --:--:-- --:--:-- --:--:-- 58
This issue is sort of addressed here:
https://github.com/docker/compose/issues/6268
Where it is said that the OS is not supported or that we're running a 32bit instance, but of which seem to be strange because all the above tutorials are specifically for AWS EC2 Linux 2.
fwiw 'uname -m' returns aarch64.
So, does anyone have an idea of how to get a full-sized version of docker-compose instead of the 9kb file?
Thanks!
Rather than dynamically looking up the OS type, just specify the linux version...
sudo curl -L https://github.com/docker/compose/releases/download/1.26.2/docker-compose-Linux-x86_64" -o /usr/local/bin/docker-compose
I'd have to use yum instead of apt (I think, that's what I found you have to do on EC2). I tried this but it says there are a bunch of Python 3.6 dependencies missing. I only have 2.7 installed (by default) should I also install Python 3.6?
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
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/
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