当前位置:   article > 正文

Docker的安装_daemon.json daemon.conf

daemon.json daemon.conf

(一)Docker的安装

$ 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/"]
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24

(二)安装失败解决方案

2.1 启动docker失败

[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.
  • 1
  • 2
  • 3

2.2 解决方案

修改 daemon.json改成 daemon.conf

mv /etc/docker/daemon.json /etc/docker/daemon.conf
  • 1

查看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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Gausst松鼠会/article/detail/593792
推荐阅读
相关标签
  

闽ICP备14008679号