Amazon Linux 2023 install Docker compose
Amazon Linux 2023 has an unusal way to install docker compose, while docker has been added to the AWS repo they seem to have forgotten to include docker-compose, so lets fix that....
Installing Docker
Before installing Docker-Compose, we need to install Docker. In your instance, run the following commands:
sudo yum update -y
sudo yum install -y docker
Start the Docker service:
sudo service docker start
Add the ec2-user to the Docker group so you can execute Docker commands without using sudo:
sudo usermod -a -G docker ec2-user
Log out and log back in again to pick up the new Docker group permissions.
Installing Docker-Compose
To install Docker-Compose, use the following commands: we must use a github repo as the AWS extras repo is missing docker compse!!!
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
Next, set the permissions:
sudo chmod +x /usr/local/bin/docker-compose
Verify the installation:
docker-compose --version
You should see the Docker-Compose version if the installation was successful.
