CentOS7开启docker远程访问

<div id="content\_views" class="markdown\_views prism-dracula"> <!-- flowchart 箭头图标 勿删 --> <svg xmlns="http://www.w3.org/2000/svg" style="display: none;"> <path stroke-linecap="round" d="M5,0 0,2.5 5,5z" id="raphael-marker-block" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></path> </svg> <p>在 CentOS 中没有 <code>/etc/default/docker</code>,另外在 CentOS7 中也没有找到 <code>/etc/sysconfig/docker</code>这个配置文件。</p> <ol> <li><p>在 <code>/usr/lib/systemd/system/docker.service</code>,配置远程访问。主要是在 <code>\[Service\]</code> 这个部分,加上下面两个参数</p> <pre class="prettyprint"><code class="has-numbering" onclick="mdcp.signin(event)">\[Service\] ExecStart= ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock <div class="hljs-button signin" data-title="登录后复制"></div></code></pre></li> <li><p>重启 docker 服务</p> <pre class="prettyprint"><code class="has-numbering" onclick="mdcp.signin(event)">$ sudo systemctl daemon-reload $ sudo systemctl restart docker <div class="hljs-button signin" data-title="登录后复制"></div></code></pre></li> </ol> <p>在另一台机器上使用命令:</p> <pre class="prettyprint"><code class="has-numbering" onclick="mdcp.signin(event)">$ docker -H \[youtip\] version <div class="hljs-button signin" data-title="登录后复制"></div></code></pre> </div>

原文地址:https://blog.csdn.net/chenfeidi1/article/details/80866889

点赞
收藏

评论区

加载中...

相关推荐

MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1

文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s

Oracle 分组与拼接字符串同时使用

SELECTT.,ROWNUMIDFROM(SELECTT.EMPLID,T.NAME,T.BU,T.REALDEPART,T.FORMATDATE,SUM(T.S0)S0,MAX(UPDATETIME)CREATETIME,LISTAGG(TOCHAR(

手写Java HashMap源码

HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22

java反射, 不看你可别后悔

<divid"content\_views"class"markdown\_views"<!flowchart箭头图标勿删<svgxmlns"http://www.w3.org/2000/svg"style"display:none;"<pathstrokelinecap"round"d"M5,00,

AndroidStudio封装SDK的那些事

<divclass"markdown\_views"<!flowchart箭头图标勿删<svgxmlns"http://www.w3.org/2000/svg"style"display:none;"<pathstrokelinecap"round"d"M5,00,2.55,5z"id"raphael

Native memory allocation (mmap) failed to map xxx bytes for committing reserved memory

<divid"content\_views"class"markdown\_views"<!flowchart箭头图标勿删<svgxmlns"http://www.w3.org/2000/svg"style"display:none;"<pathstrokelinecap"round"d"M5,00,