CentOS安装docker

一、设置仓库

1.更新apt包索引

  • apt-get update

2.安装软件包,使它允许apt通过HTTPS使用仓库

  • apt-get install apt-transport-https ca-certificates curl software-properties-common

3.添加Docker的官方GPG密钥

  

4.使用以下命令来设置 stable 的仓库。即使你想从 _edge _ 或 test 仓库安装构建,也总是需要 stable 的仓库。要添加 _edge _ 或 test 仓库,请在下面的命令中在单词stable之后添加edge或test(或两者)

  • 这里我选择添加test

  

 

二、安装docker ce

1.更新apt包索引

  • apt-get update

2.安装最新版本有 Dcoker CE

  • apt-get install docker-ce

3.通过运行hello-world 镜像验证Docker CE是否正确安装

  • docker run hello-world

  

 

posted @ 2019-11-18 19:48  时光走散了故人。  阅读(418)  评论(0编辑  收藏  举报