目录
1.环境查看
2.卸载旧版本的docker
3.下载需要的安装包
4.设置镜像仓库
5.安装docker引擎。
6.启动docker
7.查看docker是否安装成功
8.运行hello-world镜像
1.环境查看
复制代码
1
2
3
4
5#查看内核 内核是3.10及以上 uname -r [root@localhost mengming]# uname -r 3.10.0-1062.el7.x86_64
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18# 系统版本centos7及以上 cat /etc/os-release [root@localhost mengming]# cat /etc/os-release NAME="CentOS Linux" VERSION="7 (Core)" ID="centos" ID_LIKE="rhel fedora" VERSION_ID="7" PRETTY_NAME="CentOS Linux 7 (Core)" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:centos:centos:7" HOME_URL="https://www.centos.org/" BUG_REPORT_URL="https://bugs.centos.org/" CENTOS_MANTISBT_PROJECT="CentOS-7" CENTOS_MANTISBT_PROJECT_VERSION="7" REDHAT_SUPPORT_PRODUCT="centos" REDHAT_SUPPORT_PRODUCT_VERSION="7"
2.卸载旧版本的docker
复制代码
1
2
3
4
5
6
7
8yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine
3.下载需要的安装包
复制代码
1yum install -y yum-utils
4.设置镜像仓库
复制代码
1
2
3yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo #默认是国外的
推荐改成阿里云的
复制代码
1
2
3yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
5.安装docker引擎。注意:在安装前更新一下yum软件包的索引
复制代码
1yum makecache fast
复制代码
1yum install docker-ce docker-ce-cli containerd.io
6.启动docker
复制代码
1systemctl start docker
7.查看docker是否安装成功
复制代码
1docker version
8.运行hello-world镜像
复制代码
1docker run hello-world
最后
以上就是感性小土豆最近收集整理的关于简单粗暴的八步安装docker的全部内容,更多相关简单粗暴内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复