Skip to content

Instantly share code, notes, and snippets.

@iamdylanngo
Last active December 6, 2022 11:45
Show Gist options
  • Save iamdylanngo/72a3521ebecbad373d1051333a79177f to your computer and use it in GitHub Desktop.
Save iamdylanngo/72a3521ebecbad373d1051333a79177f to your computer and use it in GitHub Desktop.
install-docker-compose-aws-user-data
#!/bin/bash
# Support ubuntu 20.04 lts
# Install docker
apt-get update
apt-get install -y \
ca-certificates \
curl \
gnupg \
lsb-release
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
apt-get update
apt-get install -y docker-ce docker-ce-cli containerd.io
usermod -aG docker ubuntu
# Install docker-compose
sudo apt-get install docker-compose-plugin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment