CentOS 7 安装 Docker

发布时间: 2023-12-09

卸载旧版本

 
# yum remove docker docker-common docker-selinux docker-engine 

安装依赖

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

设置 stable 镜像仓库

 
# yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo 

更新 yum 软件包索引

 
# yum makecache fast 

安装 DOCKER CE

 
# yum -y install docker-ce 

启动 docker

 
# systemctl start docker 

查看docker版本

 
# docker version 
 
Client: Docker Engine - Community Version: 20.10.6 API version: 1.41 Go version: go1.13.15 Git commit: 370c289 Built: Fri Apr 9 22:45:33 2021 OS/Arch: linux/amd64 Context: default Experimental: true Server: Docker Engine - Community Engine: Version: 20.10.6 API version: 1.41 (minimum version 1.12) Go version: go1.13.15 Git commit: 8728dd2 Built: Fri Apr 9 22:43:57 2021 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.4.4 GitCommit: 05f951a3781f4f2c1911b05e61c160e9c30eaa8e runc: Version: 1.0.0-rc93 GitCommit: 12644e614e25b05da6fd08a38ffa0cfe1903fdec docker-init: Version: 0.19.0 GitCommit: de40ad0 

镜像加速

  • 可到阿里云免费申请一个专属加速源
 
[root@localhost ~]# mkdir -p /etc/docker [root@localhost ~]# vim /etc/docker/daemon.json {"registry-mirrors": ["https://3t4p2x0w.mirror.aliyuncs.com"]} [root@localhost ~]# systemctl daemon-reload [root@localhost ~]# systemctl restart docker 

image.png

  1. [...]安装 Docker - 参考笔记 - ? CentOS 7 安装 Docker[...]

请在下方留下您的评论.加入TG吹水群