centos 7.8.2003版本docker安装失败问题记录

其实系统版本跟docker 关系不大,只要不是差太多就行,我安装的如下
centos版本:Release: 7.8.2003
docker版本:Docker version 17.03.2-ce
centos 7.8.2003版本docker安装失败问题记录_第1张图片

安装:
方法一:

wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-17.03.2.ce-1.el7.centos.x86_64.rpm
wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-selinux-17.03.2.ce-1.el7.centos.noarch.rpm
yum install  docker-ce-17.03.2.ce-1.el7.centos.x86_64.rpm docker-ce-selinux-17.03.2.ce-1.el7.centos.noarch.rpm

方法二(官方):

#如果你之前安装过,请先卸载
yum remove docker   docker-client    docker-client-latest     docker-common    docker-latest                   docker-latest-logrotate     docker-logrotate   docker-engine
#安装yum配置工具
yum install -y yum-utils
#配置官方yum源
yum-config-manager     --add-repo     https://download.docker.com/linux/centos/docker-ce.repo
##配置阿里云yum源
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
#安装docker
yum install docker-ce docker-ce-cli containerd.io

方法三:
不管是在 Ubuntu 或 CentOS 都只需要执行该指令就会自动安装最新版 Docker。

$ curl -fsSL "https://get.docker.com/" | sh

若果需要安装指定版本:
查看可用版本 :

yum list docker-ce --showduplicates
yum install docker-ce-18.03.1.ce

启动报错
[root@jh-java ~]# systemctl start docker
Job for docker.service failed because the control process exited with error code. See “systemctl status docker.service” and “journalctl -xe” for details.
[root@jh-java ~]# systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2020-09-18 17:25:33 CST; 6min ago
Docs: https://docs.docker.com
Process: 10174 ExecStart=/usr/bin/dockerd (code=exited, status=205/LIMITS)
Main PID: 10174 (code=exited, status=205/LIMITS)

Sep 18 17:25:33 jh-java systemd[1]: Starting Docker Application Container Engine…
Sep 18 17:25:33 jh-java systemd[10174]: Failed at step LIMITS spawning /usr/bin/dockerd: Operation not permitted
Sep 18 17:25:33 jh-java systemd[1]: docker.service: main process exited, code=exited, status=205/LIMITS
Sep 18 17:25:33 jh-java systemd[1]: Failed to start Docker Application Container Engine.
Sep 18 17:25:33 jh-java systemd[1]: Unit docker.service entered failed state.
Sep 18 17:25:33 jh-java systemd[1]: docker.service failed.

centos 7.8.2003版本docker安装失败问题记录_第2张图片

![在这里插入图片描述](https://img-blog.csdnimg.cn/2020091818054747.png#pic_center
journalctl -xe 查看报错信息:

…Failed at step LIMITS spawning /usr/bin/dockerd: Operation not permitted

…docker.service: main process exited, code=exited, status=205/LIMITS
…Failed to start Docker Application Container Engine.

最终解决方案:

修改 /usr/lib/systemd/system/docker.service
LimitNOFILE=infinity 改为 LimitNOFILE=65535 (句柄数应不大于当前系统句柄数 ulimit -a)
centos 7.8.2003版本docker安装失败问题记录_第3张图片

你可能感兴趣的:(运维部署,自动化,docker)