Skip to content

Instantly share code, notes, and snippets.

@fredhsu
Last active May 16, 2019 07:33
Show Gist options
  • Save fredhsu/f44312907452fee3c538b9d845eb606a to your computer and use it in GitHub Desktop.
Save fredhsu/f44312907452fee3c538b9d845eb606a to your computer and use it in GitHub Desktop.
Install docker for kubeadm on Ubuntu
# 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 && sudo apt-get install apt-transport-https ca-certificates curl software-properties-common -y
## Download GPG key.
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
## Add docker apt repository.
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
## Install docker.
sudo apt-get update && sudo apt-get install docker-ce=18.06.0~ce~3-0~ubuntu -y
# Setup daemon.
sudo 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