Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save alichry/894fb9779e953abfea3eeed9176c7ebf to your computer and use it in GitHub Desktop.
Save alichry/894fb9779e953abfea3eeed9176c7ebf to your computer and use it in GitHub Desktop.
Install Docker (Compose) on Amazonlinux
#!/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