Docker安装配置
环境:CentOS 7
1、升级内核,将以将内核版本升级到4.x;注意Linux内核可以多版本共存,不要直接升级内核,可能会导致系统无法启动;
2、安装相关工具;
yum install -y yum-utils device-mapper-persistent-data lvm2
3、配置docker源;
yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
4、重新生成yum缓存;
yum clean all && yum makecache
5、安装docker;
yum install docker-ce-19* docker-cli-19* -y
6、设置docker开机启动;
systemctl enable --now docker
7、docker相关配置设置;
设置镜像加速、设置cgroupdriver=systemd:
mkdir /etc/docker
cat > /etc/docker/daemon.json <<EOF
{
"exec-opts": ["native.cgroupdriver=systemd"],
"registry-mirrors": ["https://xxxxx.mirror.aliyuncs.com"]
}
EOF
8、重启docker服务;
systemctl restart docker

浙公网安备 33010602011771号