Last active
March 25, 2017 02:20
-
-
Save Quar/09c0fd99ec0e5bf58c74f638b3b5bda1 to your computer and use it in GitHub Desktop.
lazily install Docker
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 | |
# Docker (Community Edition) Installing Script | |
# usage: | |
# bash -c "$(curl -fsSL https://gist.githubusercontent.com/Quar/09c0fd99ec0e5bf58c74f638b3b5bda1/raw)" | |
# adapted from | |
# https://store.docker.com/editions/community/docker-ce-server-ubuntu?tab=description | |
# check version | |
UBUNTU_VERSION=$(lsb_release -cs) | |
echo "----> Installing Prerequisits ..." | |
if [ ${UBUNTU_VERSION} == 'xenial' ] || [ ${UBUNTU_VERSION} == 'trusty' ]; then | |
sudo apt-get -y install \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo add-apt-repository \ | |
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \ | |
$(lsb_release -cs) \ | |
stable" | |
sudo apt-get update | |
echo "----> Installing Docker (CE) ..." | |
sudo apt-get -y install docker-ce | |
echo "----> Run tests for Docker (CE) ..." | |
sudo docker run hello-world | |
else | |
echo "Docker Community Edition seems not supporting ${UBUNTU_VERSION} ..." | |
echo "https://store.docker.com/editions/community/docker-ce-server-ubuntu" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment