Skip to content

Instantly share code, notes, and snippets.

@kiview
Last active July 15, 2016 16:48
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 kiview/a1ac86c266a9670a49b179f2206afaa2 to your computer and use it in GitHub Desktop.
Save kiview/a1ac86c266a9670a49b179f2206afaa2 to your computer and use it in GitHub Desktop.
Small install script for docker on Ubunttu
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
ubuntuVersion=`lsb_release -sr`
case "$ubuntuVersion" in
14.04) echo Trusty
debianRepo="https://apt.dockerproject.org/repo ubuntu-trusty main"
;;
15.10) echo Wily
debianRepo="https://apt.dockerproject.org/repo ubuntu-wily main"
;;
16.04) echo Xenial
debianRepo="https://apt.dockerproject.org/repo ubuntu-xenial main"
;;
*) >&2 echo "Ubuntu version not supported"
exit 1
esac
apt-get update
apt-get install -y apt-transport-https ca-certificates
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
echo "deb $debianRepo" > /etc/apt/sources.list.d/docker.list
apt-get update
apt-get purge lxc-docker
apt-get install -y linux-image-extra-$(uname -r) apparmor docker-engine
docker run hello-world
# install docker compose
curl -L https://github.com/docker/compose/releases/download/1.7.1/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
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