CentOS安装docker,安装docker


一、设置仓库

1.更新apt包索引

  • apt-get update

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

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

3.添加Docker的官方GPG密钥

  • curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
  • 通过搜索密钥的最后8个字符,确认您现在已经拥有指纹 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88 的密钥

  

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

  

 

相关内容

    暂无相关文章