Docker安装&启动&停止

1.安装Docker

官方文档: https://docs.docker.com/install/linux/docker-ce/centos/

docker的启动以及排错: https://docs.docker.com/install/linux/linux-postinstall/

1)Docker官方要求CentOS系统内核版本要大于3.10

uname -r

2)升级软件包和内核(选做)

yum update

3)开始安装

yum install -y yum-utils device-mapper-persistent-data lvm2

yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

yum install docker-ce docker-ce-cli 

报以下错误:

Problem: package docker-ce-3:19.03.3-3.el7.x86_64 requires containerd.io >= 1.2.2-3, but none of the providers can be installed

需要安装最新版本:

dnf install https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm 

查看最新版本地址:https://download.docker.com/linux/centos/7/x86_64/stable/Packages/

Docker安装&启动&停止_第1张图片

再来安装docker

yum install docker-ce docker-ce-cli 

等待安装完成,查看Docker版本

docker --version

2.启动docker

1.启动docker
systemctl start docker
2.设置为开机启动
systemctl enable docker
3.停止docker
systemctl stop docker
4.查看docker状态
systemctl status docker

Docker安装&启动&停止_第2张图片

你可能感兴趣的:(Docker安装&启动&停止)