Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing docker-compose on Amazon EC2 Linux 2. 9kb docker-compose file

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.

  1. Followed instructions to install docker https://docs.aws.amazon.com/AmazonECS/latest/developerguide/docker-basics.html
  2. 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.

  1. https://www.codegrepper.com/code-examples/php/how+to+install+docker+compose+in+ec2
  2. https://portal.cloud303.io/forum/aws-1/question/i-want-to-install-docker-compose-on-an-amazon-linux-2-ec2-instance-9
  3. https://acloudxpert.com/how-to-install-docker-compose-on-amazon
  4. 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!

like image 817
Tunnelvisie Avatar asked Sep 02 '20 14:09

Tunnelvisie


People also ask

Is Docker compose and Docker compose the same?

docker compose is the compose sub-command of the docker executable (which doesn't exist in this list docs.docker.com/engine/reference/commandline/docker). docker-compose is a separate executable: docs.docker.com/compose/reference/overview.

Can I install Docker on EC2?

To install Docker on an Amazon EC2 instanceConnect to your instance using SSH. For more information, see Connect to your Linux instance using SSH in the Amazon EC2 User Guide for Linux Instances. Update the installed packages and package cache on your instance. Install the most recent Docker Engine package.


2 Answers

followed the link to install the docker-compose link

Basically, thee are only two steps as below:

sudo 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
like image 116
Santosh Garole Avatar answered Sep 17 '22 12:09

Santosh Garole


I tried everything here mentioned, in the end, it was a problem with the symlink. The official docker page gave me the solution.

  1. sudo curl -L "https://github.com/docker/compose/releases/download/1.29.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

If it doesn't work after that command, check if you can find docker in your bin folder, e.g. with: ls /usr/local/bin/

If you can see docker-compose there, you almost made it.

  1. sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

An easy way to check if docker-compose is there and Linux able to find it, is to use `which docker-compose, also if it is linked correctly, you will get the path to docker-compose as a response.

This worked for me on a AWS EC2 instance with Linux2 as OS.

like image 21
Anthony Avatar answered Sep 20 '22 12:09

Anthony