#!/bin/bash

swapoff -a && sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab

 

yum -y install yum-utils device-mapper-persistent-data lvm2

yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

yum update -y && yum -y install docker-ce

 

mkdir -p /etc/docker

cat > /etc/docker/daemon.json <<EOF

{

"exec-opts": ["native.cgroupdriver=systemd"],

"log-driver": "json-file",

"log-opts":{

"max-size": "100m"

},

"insecure-registries": ["https://tw.docker.beacora.com"]

}

EOF

mkdir -p /etc/systemd/system/docker.service.d

systemctl daemon-reload && systemctl restart docker && systemctl enable docker