Created
January 16, 2020 08:08
-
-
Save shivekkhurana/5053d784018d4da978c157ed2f76a2cb to your computer and use it in GitHub Desktop.
Install Docker and Docker Compose on a Ubuntu Machine (Tested on AWS)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -eu | |
# Docker | |
sudo apt remove --yes docker docker-engine docker.io || true | |
sudo apt update | |
sudo apt --yes --no-install-recommends install apt-transport-https ca-certificates | |
wget --quiet --output-document=- https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/ubuntu $(lsb_release --codename --short) stable" \ | |
sudo apt update | |
sudo apt --yes --no-install-recommends install docker-ce | |
sudo usermod --append --groups docker "$USER" | |
sudo systemctl enable docker | |
printf '\nDocker installed successfully\n\n' | |
printf 'Waiting for Docker to start...\n\n' | |
sleep 3 | |
# Docker Compose | |
sudo curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose | |
sudo chmod +x /usr/local/bin/docker-compose | |
printf '\nDocker Compose installed successfully\n\n' | |
docker-compose --version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment