Docker Learning Notes (03)

Docker installation, start, stop

Posted by Chen Xingxu on June 17, 2020

3.Docker入门笔记——Docker安装、启动、停止

[TOC]

升级 CentOS 7 系统内核

检查内核版本,必须是 3.10 及以上

uname -r

如果版本低,可以尝试升级软件包及内核

yum update

具体升级内核的方法可以查看下面这篇博文:

Linux CentOS7升级内核至最新的方法

安装 Docker

yum install -y docker

启动 Docker

systemctl start docker
docker -v

开机启动 Docker

systemctl enable docker

停止 Docker

systemctl stop docker

Docker 更换国内源

vi /etc/docker/daemon.json

添加以下内容:

{
  "registry-mirrors": [
    "https://hub-mirror.c.163.com",
    "https://docker.mirrors.ustc.edu.cn",
    "https://3laho3y3.mirror.aliyuncs.com",
    "http://f1361db2.m.daocloud.io"
  ]
}

重启:

systemctl daemon-reload

systemctl restart docker