Skip to content

Instantly share code, notes, and snippets.

@fredhsu
Last active May 16, 2019 07:33
Show Gist options
  • Save fredhsu/b9e7f8e932813f79b4bb962754c3b2dc to your computer and use it in GitHub Desktop.
Save fredhsu/b9e7f8e932813f79b4bb962754c3b2dc to your computer and use it in GitHub Desktop.
Install docker runtime for debian stretch
# Install Docker from Ubuntu's repositories:
sudo apt-get update
sudo apt-get install -y docker.io
# or install Docker CE 18.06 from Docker's repositories for Ubuntu or Debian:
## Install prerequisites.
sudo apt-get update && apt-get install apt-transport-https ca-certificates curl software-properties-common -y
## Download GPG key.
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
## Add docker apt repository.
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/debian \
$(lsb_release -cs) \
stable"
## Install docker.
sudo apt-get install docker-ce docker-ce-cli containerd.io
# Setup daemon.
cat > /etc/docker/daemon.json <<EOF
{
"exec-opts": ["native.cgroupdriver=systemd"],
"log-driver": "json-file",
"log-opts": {
"max-size": "100m"
},
"storage-driver": "overlay2"
}
EOF
sudo mkdir -p /etc/systemd/system/docker.service.d
# Restart docker.
sudo systemctl daemon-reload
sudo systemctl restart docker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment