Last active
December 11, 2019 08:55
-
-
Save mraaroncruz/a3c19e4b901846bea872e5f24e617d55 to your computer and use it in GitHub Desktop.
Bootstrap docker and compose on new machine
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/bash | |
# Run like | |
# $ curl https://gist.githubusercontent.com/mraaroncruz/a3c19e4b901846bea872e5f24e617d55/raw/2948b92e094215542c9679a9384694c5c6e5e9dd/install_docker_and_compose.bash | bash | |
set -e | |
setup () { | |
### Update the apt package index: | |
sudo apt update | |
sudo apt upgrade -y | |
### Install packages to allow apt to use a repository over HTTPS: | |
sudo apt -y install \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
git \ | |
software-properties-common | |
# Install docker | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo apt-key fingerprint 0EBFCD88 | |
sudo add-apt-repository \ | |
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \ | |
$(lsb_release -cs) \ | |
stable" | |
sudo apt update | |
sudo apt -y install docker-ce | |
# Install docker-compose | |
sudo curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | |
sudo chmod +x /usr/local/bin/docker-compose | |
ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose | |
} | |
echo "## Installing docker and docker-compose ##" && setup | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment