CentOs7如何安装Docker

docker安装过程

1.安装需要的软件包

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

2.切换安装源

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

3.检测优先使用的安装源 

yum makecache fast

4.安装docker开源社区版 

yum -y install docker-ce

5.启动docker服务

service docker start

6.查看docker版本

docker version

7.拉取一个名为helloworld的docker镜像

docker pull hello-world

8.通过镜像启动这个helloworld程序

docker run hello-world

弹出welcome证明验证docker成功

 

ps:当我们使用docker从网上仓库拉取镜像时,走的是外网。如果你没有梯子可能会等待很长时间甚至拉取失败,阿里云有一个加速服务。下一篇博客教你如何使用它

发布了308 篇原创文章 · 获赞 157 · 访问量 14万+

猜你喜欢

转载自blog.csdn.net/Delicious_Life/article/details/104108618