Skip to content

Instantly share code, notes, and snippets.

@TsutomuNakamura
Last active March 25, 2018 12:19
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 TsutomuNakamura/36920d251c81ec6638f7 to your computer and use it in GitHub Desktop.
Save TsutomuNakamura/36920d251c81ec6638f7 to your computer and use it in GitHub Desktop.
Ubuntu にリポジトリから最新のDocker をインストールする
#!/bin/bash -eu
# Reference https://docs.docker.com/engine/installation/ubuntulinux/
[ "$(id -u)" != "0" ] && echo "You must run this script as root." && exit 1
. /etc/os-release
[ "${NAME,,}" != "ubuntu" ] && echo "Sorry, this script doesn't support the distribution $NAME" && exit 1
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
. /etc/lsb-release
echo "deb https://apt.dockerproject.org/repo ubuntu-${DISTRIB_CODENAME,,} main" > /etc/apt/sources.list.d/docker.list
apt-get update
apt-get -y purge lxc-docker || true
sudo apt-get -y install linux-image-extra-$(uname -r) docker-engine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment