Last active
December 10, 2017 00:03
-
-
Save nategraf/1fe3bcfeca76042abb5eef9a9cfcc9c2 to your computer and use it in GitHub Desktop.
Install docker and docker-compose for Ubuntu
This file contains hidden or 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 | |
# curl https://gist.githubusercontent.com/nategraf/1fe3bcfeca76042abb5eef9a9cfcc9c2/raw/f497a81610d50719353e1025922f76d4d0f6ed38/install-docker.sh | sudo bash | |
function confirm () { | |
while true; do | |
read -p "Does this look right?" yn | |
case $yn in | |
[Yy]* ) make install; break;; | |
[Nn]* ) exit;; | |
* ) echo "Please answer yes or no.";; | |
esac | |
done | |
} | |
# Install dependencies | |
sudo apt-get update | |
sudo apt-get install -y\ | |
linux-image-extra-$(uname -r) \ | |
linux-image-extra-virtual | |
sudo apt-get install -y\ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
software-properties-common | |
# Add the repo | |
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" | |
# Install docker | |
sudo apt-get update | |
sudo apt-get install -y docker-ce | |
# Install docker-compose | |
sudo curl -L "https://github.com/docker/compose/releases/download/1.11.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | |
sudo chmod +x /usr/local/bin/docker-compose |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment