Skip to content

Instantly share code, notes, and snippets.

@gonzalo123
Created November 21, 2020 11:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gonzalo123/d0156a23dbd590e6126409bc9889b514 to your computer and use it in GitHub Desktop.
Save gonzalo123/d0156a23dbd590e6126409bc9889b514 to your computer and use it in GitHub Desktop.
docker on ec2 (AMI)
#! /bin/bash
yum update -y
yum install -y docker
usermod -a -G docker ec2-user
curl -L https://github.com/docker/compose/releases/download/1.25.5/docker-compose-`uname -s`-`uname -m` | sudo tee /usr/local/bin/docker-compose > /dev/null
chmod +x /usr/local/bin/docker-compose
service docker start
chkconfig docker on
rm /etc/localtime
ln -s /usr/share/zoneinfo/Europe/Madrid /etc/localtime
ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
docker swarm init
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment