Skip to content

Instantly share code, notes, and snippets.

@zthxxx
Last active May 9, 2018 17:59
Show Gist options
  • Save zthxxx/772178f5393b07c1e1bb7536c5f95c3d to your computer and use it in GitHub Desktop.
Save zthxxx/772178f5393b07c1e1bb7536c5f95c3d to your computer and use it in GitHub Desktop.
install docker with DEB package on debian / ubuntu
#!/usr/bin/env bash
# curl -sL https://gist.githubusercontent.com/zthxxx/772178f5393b07c1e1bb7536c5f95c3d/raw/deb-install-docker.sh | bash
specify_user="${1:-root}"
apt update
apt install -y apt-transport-https ca-certificates curl gnupg2 software-properties-common
apt remove -y docker docker-engine docker.io
LSB=`lsb_release -is | tr '[:upper:]' '[:lower:]'`
curl -fsSL https://download.docker.com/linux/${LSB:-debian}/gpg | apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/${LSB:-debian} $(lsb_release -cs) stable"
# A testing release is available for Ubuntu 18.04 it can installed as follows:
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/${LSB:-debian} $(lsb_release -cs) test"
apt update
apt install -y docker-ce
if [[ "$specify_user" != "root" ]] \
&& command -v docker > /dev/null; then
usermod -aG docker "$specify_user"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment