如何在Linux系统安装docker,让你轻松更换系统环境
注意事项:
Docker 要求 CentOS 系统的内核版本高于 3.10 通过 uname -r 命令查看你当前的内核版本
安装步骤
root账户登录,查看内核版本如下 uname -r

安装需要的软件包, yum-util 提供yum-config-manager功能,另外两个是devicemapper驱动依赖的 yum install -y yum-utils
device-mapper-persistent-data lvm2

我这个自己的centos 7 已经安装了大部分的软件包了
设置yum源(选择其中一个)
yum-config-manager --add-repo
http://download.docker.com/linux/centos/docker-ce.repo(中央仓库)
yum-config-manager --add-repo
http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo(阿里仓库)

可以查看所有仓库中所有docker版本,并选择特定版本安装 yum list docker-ce --showduplicates | sort –r

yum install docker-ce-版本号,我选的是
docker-ce-18.03.1.ce-1.el7.centos,如下 yum install
docker-ce-18.03.1.ce-1.el7.centos

启动Docker,命令:systemctl start docker,然后加入开机启动,如下 systemctl start docker systemctl enable docker docker version

这样就安装好了。
相关推荐
-
PHP8种变量类型的详细讲解2025-02-22 00:32:24
-
php+apache 和 php+nginx的区别2025-02-22 00:21:27
-
PHP:与workerman结合实现定时任务2025-02-22 00:15:57
-
Nginx的Rewrite规则与实例2025-02-22 00:15:39
-
MySql中身份证字段的简单脱敏介绍2025-02-22 00:15:36