Skip to content

Instantly share code, notes, and snippets.

@luisgagocasas
Forked from nicosingh/bootstrap.yml
Created January 4, 2022 16:24
Show Gist options
  • Save luisgagocasas/30244417c81978e465afb848469fdfe3 to your computer and use it in GitHub Desktop.
Save luisgagocasas/30244417c81978e465afb848469fdfe3 to your computer and use it in GitHub Desktop.
Install Docker Ubuntu 18 server on EC2
#!/bin/bash
apt-get update -y
apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
apt-get update -y
apt-get install docker-ce -y
usermod -aG docker ubuntu
curl -L "https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
# docker swarm init --advertise-addr $(curl http://169.254.169.254/latest/meta-data/local-ipv4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment