mirror of
https://github.com/jaywcjlove/reference.git
synced 2025-06-18 05:01:21 +08:00
doc: Update docker.md (#429)
Add shortcuts of exit docker container 870cc88b2a
This commit is contained in:
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 5.4 MiB After Width: | Height: | Size: 5.4 MiB |
@ -33,7 +33,7 @@
|
||||
<p>这是 <a href="https://docs.docker.com/get-started/">Docker</a> 的快速参考备忘单。 你可以在这里找到最常见的 Docker 命令。</p>
|
||||
</div></header><div class="menu-tocs"><div class="menu-btn"><svg aria-hidden="true" fill="currentColor" height="1em" width="1em" viewBox="0 0 16 16" version="1.1" data-view-component="true">
|
||||
<path fill-rule="evenodd" d="M2 4a1 1 0 100-2 1 1 0 000 2zm3.75-1.5a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5zm0 5a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5zm0 5a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5zM3 8a1 1 0 11-2 0 1 1 0 012 0zm-1 6a1 1 0 100-2 1 1 0 000 2z"></path>
|
||||
</svg></div><div class="menu-modal"><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#入门">入门</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#入门-1">入门</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#一般命令">一般命令</a><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#docker-容器">Docker 容器</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#启动和停止">启动和停止</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#说明">说明</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#创建容器">创建容器</a><a aria-hidden="true" class="leve4 tocs-link" data-num="4" href="#实例">实例</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#操控">操控</a><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#docker-镜像">Docker 镜像</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#操控-1">操控</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#构建镜像">构建镜像</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#删除-none-镜像">删除 <none> 镜像</a><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#docker-网络">Docker 网络</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#操作">操作</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#创建网络">创建网络</a><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#各种各样的">各种各样的</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#docker-hub">Docker Hub</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#镜像仓库命令">镜像仓库命令</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#批量清除">批量清除</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#卷-volume">卷 volume</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#docker-compose">Docker Compose</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#docker-services">Docker Services</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#docker-stack">Docker Stack</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#docker-machine">Docker Machine</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#docker-主要命令">docker 主要命令</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#docker-runcreate">docker run/create</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#docker-全局参数">docker 全局参数</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#docker-管理命令">docker 管理命令</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#docker-images">docker images</a><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#docker-示例">Docker 示例</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#docker-web-管理工具-portainer">Docker Web 管理工具 portainer</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#在线代码编辑器-code-server">在线代码编辑器 Code Server</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#mysql">MySQL</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#redis">Redis</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#nginx">Nginx</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#postgresql">PostgreSQL</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#媒体管理工具-dim">媒体管理工具 Dim</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#gitlab">Gitlab</a><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#另见">另见</a></div></div><div class="h1wrap-body"><div class="wrap h2body-exist"><div class="wrap-header h2wrap"><h2 id="入门"><a aria-hidden="true" tabindex="-1" href="#入门"><span class="icon icon-link"></span></a>入门</h2><div class="wrap-body">
|
||||
</svg></div><div class="menu-modal"><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#入门">入门</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#入门-1">入门</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#一般命令">一般命令</a><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#docker-容器">Docker 容器</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#启动和停止">启动和停止</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#说明">说明</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#创建容器">创建容器</a><a aria-hidden="true" class="leve4 tocs-link" data-num="4" href="#实例">实例</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#操控">操控</a><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#docker-镜像">Docker 镜像</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#操控-1">操控</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#构建镜像">构建镜像</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#删除-none-镜像">删除 <none> 镜像</a><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#docker-网络">Docker 网络</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#操作">操作</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#创建网络">创建网络</a><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#docker-快捷键">Docker 快捷键</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#退出">退出</a><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#各种各样的">各种各样的</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#docker-hub">Docker Hub</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#镜像仓库命令">镜像仓库命令</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#批量清除">批量清除</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#卷-volume">卷 volume</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#docker-compose">Docker Compose</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#docker-services">Docker Services</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#docker-stack">Docker Stack</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#docker-machine">Docker Machine</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#docker-主要命令">docker 主要命令</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#docker-runcreate">docker run/create</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#docker-全局参数">docker 全局参数</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#docker-管理命令">docker 管理命令</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#docker-images">docker images</a><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#docker-示例">Docker 示例</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#docker-web-管理工具-portainer">Docker Web 管理工具 portainer</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#在线代码编辑器-code-server">在线代码编辑器 Code Server</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#mysql">MySQL</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#redis">Redis</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#nginx">Nginx</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#postgresql">PostgreSQL</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#媒体管理工具-dim">媒体管理工具 Dim</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#gitlab">Gitlab</a><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#另见">另见</a></div></div><div class="h1wrap-body"><div class="wrap h2body-exist"><div class="wrap-header h2wrap"><h2 id="入门"><a aria-hidden="true" tabindex="-1" href="#入门"><span class="icon icon-link"></span></a>入门</h2><div class="wrap-body">
|
||||
<!--rehype:body-class=cols-2-->
|
||||
</div></div><div class="h2wrap-body cols-2"><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="入门-1"><a aria-hidden="true" tabindex="-1" href="#入门-1"><span class="icon icon-link"></span></a>入门</h3><div class="wrap-body">
|
||||
<p>在后台创建和运行容器</p>
|
||||
@ -333,6 +333,32 @@
|
||||
</span><span class="code-line"> --aux-address<span class="token operator">=</span><span class="token string">"my-nas=192.170.1.6"</span> <span class="token punctuation">\</span>
|
||||
</span><span class="code-line"> MyOverlayNetwork
|
||||
</span></code></pre>
|
||||
</div></div></div></div></div><div class="wrap h2body-exist"><div class="wrap-header h2wrap"><h2 id="docker-快捷键"><a aria-hidden="true" tabindex="-1" href="#docker-快捷键"><span class="icon icon-link"></span></a>Docker 快捷键</h2><div class="wrap-body">
|
||||
<!--rehype:body-class=cols-2-->
|
||||
</div></div><div class="h2wrap-body cols-2"><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="退出"><a aria-hidden="true" tabindex="-1" href="#退出"><span class="icon icon-link"></span></a>退出</h3><div class="wrap-body">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<table><thead><tr><th>Docker 快捷键</th><th>说明</th></tr></thead><tbody><tr><td><code>ctrl+c</code></td><td>将关闭容器,并删除当前的容器实例</td></tr><tr><td><code>ctrl+d</code></td><td>将保留容器,并退出到Docker主机的命令行界面</td></tr><tr><td><code>ctrl+p+q</code></td><td>将容器分离,保留容器,但是不退出</td></tr></tbody></table>
|
||||
<p>需要特别注意的是,上面的退出快捷键中的删除容器实例只对于使用<code>docker attach</code>进入的容器生效,使用<code>docker exec</code>进入容器后使用上面的快捷键后将隔离容器且不会删除容器实例。</p>
|
||||
</div></div></div></div></div><div class="wrap h2body-exist"><div class="wrap-header h2wrap"><h2 id="各种各样的"><a aria-hidden="true" tabindex="-1" href="#各种各样的"><span class="icon icon-link"></span></a>各种各样的</h2><div class="wrap-body">
|
||||
<!--rehype:body-class=cols-2-->
|
||||
</div></div><div class="h2wrap-body cols-2"><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="docker-hub"><a aria-hidden="true" tabindex="-1" href="#docker-hub"><span class="icon icon-link"></span></a>Docker Hub</h3><div class="wrap-body">
|
||||
|
@ -1346,7 +1346,7 @@
|
||||
<!--rehype:class=home-card home-links-->
|
||||
<p>如果你有资源,可以很方便<a href="https://github.com/jaywcjlove/reference/issues/102#issue-1451649637">部署 web 版</a>,这非常简单,只需要克隆 <a href="https://github.com/jaywcjlove/reference/tree/gh-pages">gh-pages</a> 分支代码到你的静态服务就可以了,还可以使用 <a href="https://hub.docker.com/r/wcjiang/reference">docker</a> 快捷部署 web 版。</p>
|
||||
|
||||
</div></div><div class="h2wrap-body"></div></div></div></div><footer class="footer-wrap"><footer class="max-container">© 2022 Kenny Wang. Updated on 2023/09/12 11:10:13</footer></footer><script src="data.js?v=1.5.1" defer></script><script src="js/fuse.min.js?v=1.5.1" defer></script><script src="js/main.js?v=1.5.1" defer></script><div id="mysearch"><div class="mysearch-box"><div class="mysearch-input"><div><svg xmlns="http://www.w3.org/2000/svg" height="1em" width="1em" viewBox="0 0 18 18">
|
||||
</div></div><div class="h2wrap-body"></div></div></div></div><footer class="footer-wrap"><footer class="max-container">© 2022 Kenny Wang. Updated on 2023/09/12 23:22:13</footer></footer><script src="data.js?v=1.5.1" defer></script><script src="js/fuse.min.js?v=1.5.1" defer></script><script src="js/main.js?v=1.5.1" defer></script><div id="mysearch"><div class="mysearch-box"><div class="mysearch-input"><div><svg xmlns="http://www.w3.org/2000/svg" height="1em" width="1em" viewBox="0 0 18 18">
|
||||
<path fill="currentColor" d="M17.71,16.29 L14.31,12.9 C15.4069846,11.5024547 16.0022094,9.77665502 16,8 C16,3.581722 12.418278,0 8,0 C3.581722,0 0,3.581722 0,8 C0,12.418278 3.581722,16 8,16 C9.77665502,16.0022094 11.5024547,15.4069846 12.9,14.31 L16.29,17.71 C16.4777666,17.8993127 16.7333625,18.0057983 17,18.0057983 C17.2666375,18.0057983 17.5222334,17.8993127 17.71,17.71 C17.8993127,17.5222334 18.0057983,17.2666375 18.0057983,17 C18.0057983,16.7333625 17.8993127,16.4777666 17.71,16.29 Z M2,8 C2,4.6862915 4.6862915,2 8,2 C11.3137085,2 14,4.6862915 14,8 C14,11.3137085 11.3137085,14 8,14 C4.6862915,14 2,11.3137085 2,8 Z"></path>
|
||||
</svg><input id="mysearch-input" type="search" placeholder="搜索" autocomplete="off"><div class="mysearch-clear"></div></div><button id="mysearch-close" type="button">搜索</button></div><div class="mysearch-result"><div id="mysearch-menu"></div><div id="mysearch-content"></div></div></div></div></body>
|
||||
</html>
|
||||
|
Reference in New Issue
Block a user