赞
踩
$ 1、更新update到最新的版本 yum update $ 2、卸载老版本docker yum remove docker docker-common docker-selinux docker-engine $ 3、安装需要的软件包 yum install -y yum-utils device-mapper-persistent-data lvm2 $ 4、设置yum源 yum-config-manager --add-repo https://download.docker.com/linux/centos/docker- ce.repo $ 5、查看docker版本 yum list docker-ce --showduplicates|sort -r $ 6、安装docker yum install docker-ce-18.03.1.ce -y # 查看docker的进程 ps -aux | grep docker $ 7、启动docker systemctl start docker $ 8、加入开机自启 systemctl enable docker $ 9、配置国内镜像 vi /etc/docker/daemon.json { "registry-mirrors": ["https://cr.console.aliyun.com/"] }
[root@dockercentos ~]# systemctl start docker
Job for docker.service failed because start of the service was attempted too often. See "systemctl status docker.service" and "journalctl -xe" for details.
To force a start use "systemctl reset-failed docker.service" followed by "systemctl start docker.service" again.
修改 daemon.json改成 daemon.conf
mv /etc/docker/daemon.json /etc/docker/daemon.conf
查看docker服务是否启动
# 查看docker服务是否启动
[root@dockercentos /]# systemctl status docker.service
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Active: active (running) since 二 2021-04-20 14:15:31 CST; 6min ago
Docs: https://docs.docker.com
Main PID: 2058 (dockerd)
Tasks: 15
Memory: 71.1M
CGroup: /system.slice/docker.service
└─2058 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。