Created
May 6, 2024 22:44
-
-
Save alichry/894fb9779e953abfea3eeed9176c7ebf to your computer and use it in GitHub Desktop.
Install Docker (Compose) on Amazonlinux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
sudo yum install docker | |
# start docker | |
sudo systemctl enable --now docker | |
# add ec2-user to docker group | |
sudo usermod -a -G docker ec2-user | |
# update the current session with the new group | |
newgrp docker | |
# install docker compose | |
DOCKER_CONFIG=${DOCKER_CONFIG:-/usr/local/lib/docker} | |
sudo mkdir -p $DOCKER_CONFIG/cli-plugins | |
sudo curl -SL https://github.com/docker/compose/releases/download/v2.26.1/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose | |
sudo chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment