# 添加docker用户, 并把当前用户添加到docker组内, 是为了当前用户拥有操作docker的权限
sudo useradd -m docker
sudo usermod -a -G docker k8s
# 关闭防火墙
sudo systemctl stop firewalld
sudo systemctl disable firewalld
# 修改iptables
sudo iptables -P FORWARD ACCEPT
sudo vim /etc/rc.local 添加 iptables -P FORWARD ACCEPT
# 安装必要程序
sudo yum install -y yum-utils \
device-mapper-persistent-data \
lvm2
# 安装containerd
yum install -y https://download.docker.com/linux/fedora/30/x86_64/stable/Packages/containerd.io-1.2.6-3.3.fc30.x86_64.rpm
# 配置docker源
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
# 查版docker本号
yum list docker-ce --showduplicates | sort -r
# 选择最新的安装
sudo yum install docker-ce-3:19.03.6-3.el7
sudo systemctl start docker
sudo systemctl enable docker
docker run hello-world
来源:oschina
链接:https://my.oschina.net/imhuayi/blog/3175320