Created
August 21, 2019 06:38
-
-
Save eohtake/897656ff1898f9c58146c9e6a5ceb8d4 to your computer and use it in GitHub Desktop.
Docker configuration for Kubernetes - 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
#!/bin/bash | |
# Install Docker CE | |
## Set up the repository: | |
### Install packages to allow apt to use a repository over HTTPS | |
apt-get update && apt-get install apt-transport-https ca-certificates curl software-properties-common | |
### Add Docker’s official GPG key | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - | |
### Add Docker apt repository. | |
add-apt-repository \ | |
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \ | |
$(lsb_release -cs) \ | |
stable" | |
## Install Docker CE. | |
apt-get update && apt-get install docker-ce=18.06.2~ce~3-0~ubuntu | |
# 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 | |
mkdir -p /etc/systemd/system/docker.service.d | |
# Restart docker. | |
systemctl daemon-reload | |
systemctl restart docker |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment