Skip to content

Instantly share code, notes, and snippets.

@get-data-
Created June 21, 2019 14:20
Show Gist options
  • Save get-data-/c14bd3e29af7ce991828ec6a00f7afea to your computer and use it in GitHub Desktop.
Save get-data-/c14bd3e29af7ce991828ec6a00f7afea to your computer and use it in GitHub Desktop.
Install Code Deploy, Docker, and Docker-Compose to a fresh EC2 instance
#!/bin/bash
sudo apt-get -y update
sudo apt-get -y install ruby
sudo apt-get -y install wget
cd /home/ubuntu
wget https://aws-codedeploy-us-east-1.s3.amazonaws.com/latest/install
sudo chmod +x ./install
sudo ./install auto
# update the packages index
sudo apt install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common
# Import the repository’s GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# set up the stable repository
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get -y update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
sudo apt-get install -y jq
VERSION=$(curl --silent https://api.github.com/repos/docker/compose/releases/latest | jq .name -r)
DESTINATION=/usr/local/bin/docker-compose
sudo curl -L https://github.com/docker/compose/releases/download/${VERSION}/docker-compose-$(uname -s)-$(uname -m) -o $DESTINATION
sudo chmod 755 $DESTINATION
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment