跳至内容
技术分享
站点工具
工具
显示页面
修订记录
反向链接
最近更改
媒体管理器
网站地图
登录
>
最近更改
媒体管理器
网站地图
登录
搜索
您的足迹:
服务器技术:docker:安装docker
本页面只读。您可以查看源文件,但不能更改它。如果您觉得这是系统错误,请联系管理员。
<h2><br/></h2><h2><a href="https://www.cnblogs.com/yufeng218/p/8370670.html">Centos7上安装docker</a></h2><p><br/></p><p><span style="font-size: 16px">Docker从1.13版本之后采用时间线的方式作为版本号,分为社区版CE和企业版EE。</span></p><p><span style="font-size: 16px">社区版是免费提供给个人开发者和小型团体使用的,企业版会提供额外的收费服务,比如经过官方测试认证过的基础设施、容器、插件等。</span></p><p><span style="font-size: 16px">社区版按照stable和edge两种方式发布,每个季度更新stable版本,如17.06,17.09;每个月份更新edge版本,如17.09,17.10。</span></p><h2> 一、安装docker</h2><p>1、Docker 要求 CentOS 系统的内核版本高于 3.10 ,查看本页面的前提条件来验证你的CentOS 版本是否支持 Docker 。</p><p>通过 <strong>uname -r </strong>命令查看你当前的内核版本</p><pre> $ uname -r</pre><p><span style="font-size: 16px">2、使用 <code>root</code> 权限登录 Centos。确保 yum 包更新到最新。</span></p><pre>$ sudo yum update</pre><p><span style="font-size: 16px">3、卸载旧版本(如果安装过旧版本的话)</span></p><pre>$ sudo yum remove docker docker-common docker-selinux docker-engine</pre><p><span style="font-size: 16px">4、安装需要的软件包, </span><span style="font-size: 16px">yum-util 提供yum-config-manager功能,</span><span class="pln" style="font-size: 16px"><span class="com">另外两个是devicemapper驱动依赖的</span></span></p><pre>$ sudo yum install -y yum-utils device-mapper-persistent-data lvm2</pre><p>5、设置yum源</p><pre>$ sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo</pre><p> <img src="/dokuwiki/ueditor/php/upload/image/20180605/1528193158841130.png" alt=""/></p><p>6、可以查看所有仓库中所有docker版本,并选择特定版本安装</p><pre>$ yum list docker-ce --showduplicates | sort -r</pre><p><img src="/dokuwiki/ueditor/php/upload/image/20180605/1528193158953553.png" alt=""/></p><p>7、安装docker</p><pre>$ sudo yum install docker-ce #由于repo中默认只开启stable仓库,故这里安装的是最新稳定版17.12.0$ sudo yum install <FQPN> # 例如:sudo yum install docker-ce-17.12.0.ce</pre><p> <img src="/dokuwiki/ueditor/php/upload/image/20180605/1528193158168601.png" alt=""/></p><p><span style="font-size: 16px">8、启动并加入开机启动</span></p><pre>$ sudo systemctl start docker $ sudo systemctl enable docker</pre><p><span style="font-size: 16px">9、验证安装是否成功(有client和service两部分表示docker安装启动都成功了)</span></p><pre>$ docker version</pre><p><img src="/dokuwiki/ueditor/php/upload/image/20180605/1528193158728987.png" alt=""/></p><p> </p><h2> 二、问题</h2><p><span style="font-size: 16px">1、因为之前已经安装过旧版本的docker,在安装的时候报错如下:</span></p><p><span class="cnblogs_code_copy"><a title="复制代码"><img src="/dokuwiki/ueditor/php/upload/image/20180605/1528193159785842.gif" alt="复制代码"/></a></span></p><pre>Transaction check error: file /usr/bin/docker from install of docker-ce-17.12.0.ce-1.el7.centos.x86_64 conflicts with file from package docker-common-2:1.12.6-68.gitec8512b.el7.centos.x86_64 file /usr/bin/docker-containerd from install of docker-ce-17.12.0.ce-1.el7.centos.x86_64 conflicts with file from package docker-common-2:1.12.6-68.gitec8512b.el7.centos.x86_64 file /usr/bin/docker-containerd-shim from install of docker-ce-17.12.0.ce-1.el7.centos.x86_64 conflicts with file from package docker-common-2:1.12.6-68.gitec8512b.el7.centos.x86_64 file /usr/bin/dockerd from install of docker-ce-17.12.0.ce-1.el7.centos.x86_64 conflicts with file from package docker-common-2:1.12.6-68.gitec8512b.el7.centos.x86_64</pre><p><span class="cnblogs_code_copy"><a title="复制代码"><img src="/dokuwiki/ueditor/php/upload/image/20180605/1528193159785842.gif" alt="复制代码"/></a></span></p><p><span style="font-size: 16px">2、卸载旧版本的包</span></p><pre>$ sudo yum erase docker-common-2:1.12.6-68.gitec8512b.el7.centos.x86_64</pre><p><img src="/dokuwiki/ueditor/php/upload/image/20180605/1528193159830412.png" alt=""/></p><p><span style="font-size: 16px">3、再次安装docker</span></p><pre>$ sudo yum install docker-ce</pre><p><br/></p><p><br/></p><p><a href="https://www.cnblogs.com/yufeng218/p/8370670.html" target="_blank">https://www.cnblogs.com/yufeng218/p/8370670.html</a></p><p><br/></p><h1 class="YaHei" style="margin: 0px; padding: 0px 0px 5px; outline: none; font-size: 20px; font-weight: bold; font-family: "Microsoft YaHei"; color: rgb(51, 51, 51); line-height: 35px; overflow: hidden; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);">docker测试时候命令无法补全的解决方法</h1><p style="margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; color: rgb(34, 34, 34); font-family: tahoma, arial, "Microsoft YaHei"; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);"><span style="line-height: 25.2px; font-size: 14px; color: rgb(255, 0, 0);"><strong>发现问题</strong></span></p><p style="margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; color: rgb(34, 34, 34); font-family: tahoma, arial, "Microsoft YaHei"; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);">在输入docker swarm 然后tab键不能像这样进行提示 和补全<br/></p><p style="margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; color: rgb(34, 34, 34); font-family: tahoma, arial, "Microsoft YaHei"; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);">tab 键也无法补全nginx容器名,下面是运行截图<br/></p><p style="margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; color: rgb(34, 34, 34); font-family: tahoma, arial, "Microsoft YaHei"; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-align: center;"><a href="https://files.jb51.net/file_images/article/201611/2016115101639480.png?2016105101650" target="_blank" class="bPic" style="color: rgb(66, 139, 202); text-decoration: none; font-size: 14px;"><img src="https://files.jb51.net/file_images/article/201611/2016115101639480.png?2016105101650" alt="" width="1428" height="171"/></a></p><p style="margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; color: rgb(34, 34, 34); font-family: tahoma, arial, "Microsoft YaHei"; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-align: center;"><img src="https://files.jb51.net/file_images/article/201611/2016115101711227.png?2016105101720" alt=""/></p><p style="margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; color: rgb(34, 34, 34); font-family: tahoma, arial, "Microsoft YaHei"; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);"><span style="line-height: 25.2px; font-size: 14px; color: rgb(255, 0, 0);"><strong>解决方法:</strong></span><br/></p><p><span style="line-height: 25.2px; font-size: 14px;"><a href="https://www.jb51.net/article/96555.htm#" class="toolbar_item command_help help" style="color: rgb(66, 139, 202); text-decoration: none; border-radius: 0px !important; background: none !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 1px 0px 0px !important; position: static !important; right: auto !important; text-align: center !important; top: auto !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 14px; min-height: auto !important; display: block !important;">?</a></span></p><table width="643"><tbody style="border-radius: 0px !important; background: none !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; min-height: auto !important;"><tr style="border-radius: 0px !important; background: none !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; min-height: auto !important;" class="firstRow"><td class="gutter" style="margin: 0px !important; padding: 0.2em 0.46em; outline: currentcolor none 0px !important; border-radius: 0px !important; background: rgba(0, 0, 0, 0) none repeat scroll 0% 0% !important; border: 1px solid rgb(204, 204, 204); bottom: auto !important; float: none !important; left: auto !important; line-height: 1.1em !important; overflow: visible !important; position: static !important; right: auto !important; text-align: left; top: auto !important; vertical-align: baseline !important; box-sizing: content-box !important; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; min-height: auto !important; color: rgb(175, 175, 175) !important;" width="NaN"><div class="line number1 index0 alt2" style="margin: 0px !important; padding: 0px 0.5em 0px 1em !important; outline: 0px !important; border-radius: 0px !important; background: none white !important; border-width: 0px 3px 0px 0px !important; border-top-style: initial !important; border-right-style: solid !important; border-bottom-style: initial !important; border-left-style: initial !important; border-top-color: initial !important; border-right-color: rgb(108, 226, 108) !important; border-bottom-color: initial !important; border-left-color: initial !important; border-image: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 15.4px; overflow: visible !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 14px; min-height: auto !important; white-space: pre !important;">1</div></td><td class="code" style="margin: 0px !important; padding: 0.2em 0.46em; outline: currentcolor none 0px !important; border-radius: 0px !important; background: rgba(0, 0, 0, 0) none repeat scroll 0% 0% !important; border: 1px solid rgb(204, 204, 204); bottom: auto !important; float: none !important; left: auto !important; line-height: 1.1em !important; overflow: visible !important; position: static !important; right: auto !important; text-align: left; top: auto !important; vertical-align: baseline !important; box-sizing: content-box !important; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; min-height: auto !important;" width="611"><div class="line number1 index0 alt2" style="margin: 0px !important; padding: 0px 1em !important; outline: 0px !important; border-radius: 0px !important; background: none white !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 15.4px; overflow: visible !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 14px; min-height: auto !important; white-space: pre !important;"><code class="bash plain" style="margin: 3px auto 0px; padding: 0px 0px 0px 5px; outline: 0px !important; font-style: normal !important; font-weight: normal !important; border-radius: 0px !important; background: rgb(255, 255, 255); border-top: 0px !important; border-right: 0px !important; border-bottom: 0px !important; border-left: 3px solid rgb(108, 226, 108); border-image: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 20px; overflow: visible !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: 640px; box-sizing: content-box !important; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; font-size: 14px; min-height: auto !important; color: black !important; clear: both;">yum </code><code class="bash functions" style="margin: 3px auto 0px; padding: 0px 0px 0px 5px; outline: 0px !important; font-style: normal !important; font-weight: normal !important; border-radius: 0px !important; background: rgb(255, 255, 255); border-top: 0px !important; border-right: 0px !important; border-bottom: 0px !important; border-left: 3px solid rgb(108, 226, 108); border-image: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 20px; overflow: visible !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: 640px; box-sizing: content-box !important; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; font-size: 14px; min-height: auto !important; color: rgb(255, 20, 147) !important; clear: both;">install</code> <code class="bash plain" style="margin: 3px auto 0px; padding: 0px 0px 0px 5px; outline: 0px !important; font-style: normal !important; font-weight: normal !important; border-radius: 0px !important; background: rgb(255, 255, 255); border-top: 0px !important; border-right: 0px !important; border-bottom: 0px !important; border-left: 3px solid rgb(108, 226, 108); border-image: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 20px; overflow: visible !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: 640px; box-sizing: content-box !important; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; font-size: 14px; min-height: auto !important; color: black !important; clear: both;">-y </code><code class="bash functions" style="margin: 3px auto 0px; padding: 0px 0px 0px 5px; outline: 0px !important; font-style: normal !important; font-weight: normal !important; border-radius: 0px !important; background: rgb(255, 255, 255); border-top: 0px !important; border-right: 0px !important; border-bottom: 0px !important; border-left: 3px solid rgb(108, 226, 108); border-image: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 20px; overflow: visible !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: 640px; box-sizing: content-box !important; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; font-size: 14px; min-height: auto !important; color: rgb(255, 20, 147) !important; clear: both;">bash</code><code class="bash plain" style="margin: 3px auto 0px; padding: 0px 0px 0px 5px; outline: 0px !important; font-style: normal !important; font-weight: normal !important; border-radius: 0px !important; background: rgb(255, 255, 255); border-top: 0px !important; border-right: 0px !important; border-bottom: 0px !important; border-left: 3px solid rgb(108, 226, 108); border-image: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 20px; overflow: visible !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: 640px; box-sizing: content-box !important; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; font-size: 14px; min-height: auto !important; color: black !important; clear: both;">-completion</code></div></td></tr></tbody></table><p style="margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; color: rgb(34, 34, 34); font-family: tahoma, arial, "Microsoft YaHei"; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);">退出 后重进就正常了</p><p><br/></p>
服务器技术/docker/安装docker.1536569427.txt.gz
· 最后更改: 2018/09/10 18:01 (外部编辑)
页面工具
显示页面
修订记录
反向链接
页面重命名
回到顶部