Skip to content

Instantly share code, notes, and snippets.

@paulgessinger
Last active October 16, 2017 08:06
Show Gist options
  • Save paulgessinger/5651008f1486e9eb0eacc1941b06423b to your computer and use it in GitHub Desktop.
Save paulgessinger/5651008f1486e9eb0eacc1941b06423b to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
apt-get update
apt-get upgrade -y
apt-get dist-upgrade -y
apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg2 \
software-properties-common
curl -fsSL https://download.docker.com/linux/$(. /etc/os-release; echo "$ID")/gpg | apt-key add -
arch=`dpkg --print-architecture`
if [ "$arch" == "amd64" ]; then
add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") \
$(lsb_release -cs) \
stable"
elif [ "$arhc" == "armhf" ]; then
echo "deb [arch=armhf] https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") \
$(lsb_release -cs) stable" | \
tee /etc/apt/sources.list.d/docker.list
else
echo "Unknown arch $arch"
exit 1
fi
apt-get update
apt-get install -y docker-ce
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment