Last active
May 16, 2019 07:33
-
-
Save fredhsu/f44312907452fee3c538b9d845eb606a to your computer and use it in GitHub Desktop.
Install docker for kubeadm on Ubuntu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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