# docker安装脚本

centos8 安装docker

#!/bin/bash
yum install -y yum-utils  device-mapper-persistent-data  lvm2
 
yum-config-manager  --add-repo   http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
 
yum install -y https://mirrors.aliyun.com/docker-ce/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.13-3.2.el7.x86_64.rpm

yum install -y docker-ce docker-ce-cli containerd.io

systemctl enable docker

systemctl start docker

mkdir -p /etc/docker

tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://7gbxm6b1.mirror.aliyuncs.com"],
  "log-opts": {
	  "max-size": "200m"
  }
}
EOF

firewall-cmd --permanent --zone=trusted --add-interface=docker0
firewall-cmd --permanent --zone=trusted --add-port=4243/tcp
firewall-cmd --reload

systemctl daemon-reload

systemctl restart docker

fedora 安装docker

rpmkeys --import  https://mirrors.aliyun.com/docker-ce/linux/fedora/gpg

dnf config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/fedora/docker-ce.repo

dnf install --enablerepo=docker-ce-stable --releasever=31 docker-ce docker-ce-cli containerd.io

dnf install --enablerepo=docker-ce-stable --releasever=31 docker-compose
Last Updated: 8/20/2020, 10:48:07 AM