Skip to content

Instantly share code, notes, and snippets.

@dohsimpson
Last active August 29, 2015 14:23
Show Gist options
  • Save dohsimpson/0fb8da09d2167c7e2762 to your computer and use it in GitHub Desktop.
Save dohsimpson/0fb8da09d2167c7e2762 to your computer and use it in GitHub Desktop.
Install docker and docker-compose on Ubuntu 14
#!/bin/bash
set -e
KERNEL_VERSION=`uname -r` # make sure kernel version >= 3.10
if [[ $KERNEL_VERSION != *"3.1"* ]]; then
echo "Kernel version must be >= 3.10"
fi
# for ubuntu 14: there's nothing required to install
# for ubuntu 12
UBUNTU_VERSION=`lsb_release -r`
if [[ $UBUNTU_VERSION != *"14.04"* ]]; then
echo "This script only suppport Ubuntu 14.04"
fi
# ready for install
sudo apt-get update
if [[ `which wget` -eq 1 ]]; then
echo "need to install wget..."
sudo apt-get install wget
fi
# install docker
wget -qO- https://get.docker.com/ | sh
# check docker install
echo "checking docker installation..."
sudo docker run hello-world && echo "docker installation success"
# install docker-compose
sudo wget -O "/usr/local/bin/docker-compose" "https://github.com/docker/compose/releases/download/1.3.1/docker-compose-`uname -s`-`uname -m`"
sudo chmod +x /usr/local/bin/docker-compose
echo "checking docker-compose installation..."
sudo docker-compose --version && echo "docker-compose installation success"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment