docker服务启动报错docker.service holdoff time over, scheduling restart.

2023-12-20 12:03:24

docker服务启动报错docker.service holdoff time over, scheduling restart.

卸载docker

在这里插入图片描述

卸载安装包

yum remove -y docker
docker-client
docker-client-latest
docker-ce-cli
docker-common
docker-latest
docker-latest-logrotate
docker-logrotate
docker-selinux
docker-engine-selinux
docker-engine

rm -rf /usr/lib/systemd/system/docker.service
rm -rf /etc/systemd/system/docker.service.d

-rf /var/lib/docker/
rm -rf /var/run/docker

设置 yum repository

export REGISTRY_MIRROR=https://registry.cn-hangzhou.aliyuncs.com

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

安装并启动 docker

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

配置仓库

mkdir /etc/docker || true

cat > /etc/docker/daemon.json <<EOF
{
“registry-mirrors”: [“https://registry.cn-hangzhou.aliyuncs.com”],
“exec-opts”: [“native.cgroupdriver=systemd”],
“log-driver”: “json-file”,
“log-opts”: {
“max-size”: “100m”
},
“storage-driver”: “overlay2”,
“storage-opts”: [
“overlay2.override_kernel_check=true”
]
}
EOF

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

Restart Docker

systemctl daemon-reload
systemctl enable docker
systemctl restart docker

我这边原因是配合的仓库地址不合适,
“registry-mirrors”: [“https://registry.cn-hangzhou.aliyuncs.com”],
这个弟子不合适导致,改完重启好了

文章来源:https://blog.csdn.net/qiao2458/article/details/135101983
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。