Skip to content

Instantly share code, notes, and snippets.

@Quar
Last active March 25, 2017 02:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Quar/09c0fd99ec0e5bf58c74f638b3b5bda1 to your computer and use it in GitHub Desktop.
Save Quar/09c0fd99ec0e5bf58c74f638b3b5bda1 to your computer and use it in GitHub Desktop.
lazily install Docker
#!/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