一、安装步骤
1.1、下载 docker-ce repo
为本地 yum 提供远程 repo 信息
命令:curl https://download.docker.com/linux/centos/docker-ce.repo -o /etc/yum.repos.d/docker-ce.repo
[root@localhost ~]# curl https://download.docker.com/linux/centos/docker-ce.repo -o /etc/yum.repos.d/docker-ce.repo
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2424 100 2424 0 0 3502 0 --:--:-- --:--:-- --:--:-- 3497
1.2、安装依赖
安装对应版本containerd
命令:yum install -y https://download.docker.com/linux/fedora/30/x86_64/stable/Packages/containerd.io-1.2.6-3.3.fc30.x86_64.rpm
[root@localhost yum.repos.d]# yum install -y https://download.docker.com/linux/fedora/30/x86_64/stable/Packages/containerd.io-1.2.6-3.3.fc30.x86_64.rpm
上次元数据过期检查:0:10:17 前,执行于 2020年08月02日 星期日 03时53分08秒。
containerd.io-1.2.6-3.3.fc30.x86_64.rpm 1.1 MB/s | 21 MB 00:20
依赖关系解决。
....
1.3、安装docker-ce
命令:yum install -y docker-ce
[root@localhost yum.repos.d]# yum install -y docker-ce
上次元数据过期检查:0:12:40 前,执行于 2020年08月02日 星期日 03时53分08秒。
依赖关系解决。
...
二、服务启停
2.1、启动
命令:systemctl start docker
(或service docker start)
2.2、停止
命令:systemctl stop docker
(或service docker stop)
2.3、查看状态
命令:systemctl status docker
[root@localhost yum.repos.d]# systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: active (running) since Sun 2020-08-02 04:08:30 Aisa; 9s ago
Docs: https://docs.docker.com
Main PID: 31154 (dockerd)
Tasks: 8
Memory: 99.9M
CGroup: /system.slice/docker.service
└─31154 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
....
命令:docker info
[root@localhost yum.repos.d]# docker info
Client:
Debug Mode: false
Server:
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 19.03.12
Storage Driver: overlay2
Backing Filesystem: xfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
...