ubuntu安装docker


1.首次安装Docker CE之前,需要先设置Docker仓库

$ sudo apt-get update

 

2.允许apt通过Https更新

$ sudo 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 的密钥。

$ sudo apt-key fingerprint 0EBFCD88

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

$ sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

4.开始安装Docker CE

$ sudo apt-get install docker-ce

5.选择版本

$ apt-cache madison docker-ce

6.安装选择的版本

$ sudo apt-get install docker-ce=VERSION

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

$ sudo docker run hello-world

8.查看版本

$ sudo docker version 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM