在线精品99_中国九九盗摄偷拍偷看_91免费版在线观看_91.app_91高清视频在线_99热最新网站

ubuntu怎么安装docker

129次阅读
没有评论

共计 2547 个字符,预计需要花费 7 分钟才能阅读完成。

本篇内容介绍了“ubuntu 怎么安装 docker”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让丸趣 TV 小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!

零:卸载旧版本

docker 的旧版本被称为 docker,docker.io 或 docker-engine。如果已安装,请卸载它们:

$ sudo apt-get remove docker docker-engine docker.io containerd runc

当前称为 docker engine-community 软件包 docker-ce。

一:设置仓库

在新主机上首次安装 docker engine-community 之前,需要设置 docker 仓库。之后,您可以从仓库安装和更新 docker。

更新 apt 包索引。

$ sudo apt-get update

安装 apt 依赖包,用于通过 https 来获取仓库:

$ sudo apt-get install \
 apt-transport-https \
 ca-certificates \
 curl \
 gnupg-agent \
 software-properties-common

添加 docker 的官方 gpg 密钥:

$ curl -fssl https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

9dc8 5822 9fc7 dd38 854a e2d8 8d81 803c 0ebf cd88 通过搜索指纹的后 8 个字符,验证您现在是否拥有带有指纹的密钥。

$ sudo apt-key fingerprint 0ebfcd88
 
pub rsa4096 2017-02-22 [scea]
 9dc8 5822 9fc7 dd38 854a e2d8 8d81 803c 0ebf cd88
uid [ unknown] docker release (ce deb)  [email protected] 
sub rsa4096 2017-02-22 [s]

使用以下指令设置稳定版仓库

注意:目前 20.04 还没有国内 docker 源,暂时用 18.04 版本。

$ sudo add-apt-repository \
  deb [arch=amd64] https://download.docker.com/linux/ubuntu \
 bionic \
 stable

二:安装 docker engine-community

更新 apt 包索引。

$ sudo apt-get update

安装最新版本的 docker engine-community 和 containerd

$ sudo apt-get install docker-ce docker-ce-cli containerd.io

三:测试

输入

$ sudo docker run hello-world

如果 docker 和你问好——或者说出现类似以下输出

unable to find image  hello-world:latest  locally
latest: pulling from library/hello-world
1b930d010525: pull complete digest: sha256:c3b4ada4687bbaa170745b3e4dd8ac3f194ca95b2d0518b417fb47e5879d9b5f
status: downloaded newer image for hello-world:latest

hello from docker! this message shows that your installation appears to be working correctly.
to generate this message, docker took the following steps:  1. the docker client contacted the docker daemon.  2. the docker daemon pulled the  hello-world  image from the docker hub.  (amd64)  3. the docker daemon created a new container from that image which runs the  executable that produces the output you are currently reading.  4. the docker daemon streamed that output to the docker client, which sent it  to your terminal.
to try something more ambitious, you can run an ubuntu container with:  $ docker run -it ubuntu bash
share images, automate workflows, and more with a free docker id:  https://hub.docker.com/
for more examples and ideas, visit:  https://docs.docker.com/get-started/

就说明安装完事了。

四:免 sudo 运行 镜像加速

免 sudo

参考如下方法将用户添加到 docke 组

$ sudo usermod -ag docker [你的用户名]

重启 docker

$ sudo systemctl restart docker

(然而我的机器上发生了很诡异的事——我重启 docker 服务后依然不能以普通用户启动 docker。重启机器后才能免 sudo 运行。)

docker 镜像加速

我用了阿里云的免费加速

“ubuntu 怎么安装 docker”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注丸趣 TV 网站,丸趣 TV 小编将为大家输出更多高质量的实用文章!

正文完
 
丸趣
版权声明:本站原创文章,由 丸趣 2023-07-14发表,共计2547字。
转载说明:除特殊说明外本站除技术相关以外文章皆由网络搜集发布,转载请注明出处。
评论(没有评论)
主站蜘蛛池模板: 中文字幕日本不卡 | 我爱avav好色| 福利在线免费观看 | 亚洲国产日韩在线人成电影 | 精品视频一区二区三区在线观看 | 国产精品va在线播放 | 男人进女人下部全黄大色视频 | 禁网站在线观看免费视频 | 狂躁美女大bbbbbb视频u | a级毛片免费高清视频 | 一级毛片黄 | 自拍视频在线观看 | 欧美一级特黄aa大片婷婷 | 很黄很污的视频在线观看 | 一级毛片高清大全免费观看 | 国产在线无遮挡免费观看 | 偷自拍第一页 | 国产精品久久久久久久久免费 | 亚洲精品无码久久久久av麻豆 | 99视频国产热精品视频 | 狼狼色丁香久久婷婷综合五月 | 全部免费毛片在线 | 久久六视频 | 激情按摩系列片aaaa | 日韩欧美中文字幕一区 | 小泽玛利亚跟黑人3p在线 | 麻豆三级电影 | 99国产精品国产精品 | 丰满熟妇乱又伦精品 | 牛鞭伸入女人下身的真视频 | 日韩视频在线观看一区 | 日本一级毛片一级裸片 | 国产青榴视频在线观看 | 久久久久人妻一区精品 | 国产精品熟妇一区二区三区四区 | 国精品人妻无码一区免费视频电影 | 亚洲福利视频网址 | 97久久人人超碰超碰窝窝 | 美女黄网| 2o2o天天看夜夜看狠狠看 | 成在线人免费视频 |