安装Docker
1、卸载Docker旧的版本
[root@localhost ~]# yum remove docker
docker-client
docker-client-latest
docker-common
docker-latest
docker-latest-logrotate
docker-logrotate
docker-engine
2、需要安装包
[root@localhost ~]# yum install -y yum-utils
3、设置镜像的仓库
[root@localhost ~]# yum-config-manager
--add-repo
https://download.docker.com/linux/centos/docker-ce.repo # 国外镜像地址
[root@localhost ~]# yum-config-manager
--add-repo
http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo # 国内阿里云镜像地址
4、更新yum软件包索引
[root@localhost ~]# yum makecahe fast
5、安装Docker相关的 docker-ce 社区 ee 企业版
[root@localhost ~]# yum install docker-ce docker-ce-cli containerd.io
[root@localhost ~]#
6、启动Docker
[root@localhost ~]# systemctl start docker # 启动Docker
[root@localhost ~]# docker version
[root@localhost ~]#
7、启动docker hello-world
[root@localhost ~]# docker run hello-world # 运行hello-world镜像
[root@localhost ~]# docker images # 查看运行的镜像
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest feb5d9fea6a5 7 weeks ago 13.3kB
最后
以上就是执着黑夜最近收集整理的关于Docker容器学习 -- 安装Docker的全部内容,更多相关Docker容器学习内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复