提交 2ace61f5 编写于 作者: A amyMaYun 提交者: Gitee

包名更新

上级 cfe405d6
......@@ -2,12 +2,12 @@
## 功能描述<a name="zh-cn_topic_0182200849_section1519142210555"></a>
普通容器仅支持在创建时指定--volume参数将宿主机的目录/卷挂载到容器实现资源共享,但是无法在容器运行时将挂载到容器中的目录/卷卸载掉,也不支持将宿主机的目录/卷挂载到容器。系统容器可以通过docker-tools工具实现动态将宿主机的目录/卷挂载到容器,以及将容器中的目录/卷进行卸载。
普通容器仅支持在创建时指定--volume参数将宿主机的目录/卷挂载到容器实现资源共享,但是无法在容器运行时将挂载到容器中的目录/卷卸载掉,也不支持将宿主机的目录/卷挂载到容器。系统容器可以通过isulad-tools工具实现动态将宿主机的目录/卷挂载到容器,以及将容器中的目录/卷进行卸载。
## 命令格式<a name="zh-cn_topic_0182200849_section9239248135514"></a>
```
docker-tools [COMMADN][OPTIONS] <container_id> [ARG...]
isulad-tools [COMMADN][OPTIONS] <container_id> [ARG...]
```
其中:
......@@ -25,53 +25,53 @@ ARG:命令对应的参数。
**表 1**
<a name="zh-cn_topic_0182200849_table1869210387418"></a>
<table><thead align="left"><tr id="zh-cn_topic_0182200849_row1569373816419"><th class="cellrowborder" valign="top" width="16.150000000000002%" id="mcps1.2.5.1.1"><p id="zh-cn_topic_0182200849_p106936387415"><a name="zh-cn_topic_0182200849_p106936387415"></a><a name="zh-cn_topic_0182200849_p106936387415"></a>命令</p>
</th>
<th class="cellrowborder" valign="top" width="25.77%" id="mcps1.2.5.1.2"><p id="zh-cn_topic_0182200849_p43193341215"><a name="zh-cn_topic_0182200849_p43193341215"></a><a name="zh-cn_topic_0182200849_p43193341215"></a>功能说明</p>
</th>
<th class="cellrowborder" valign="top" width="23.189999999999998%" id="mcps1.2.5.1.3"><p id="zh-cn_topic_0182200849_p11217215104712"><a name="zh-cn_topic_0182200849_p11217215104712"></a><a name="zh-cn_topic_0182200849_p11217215104712"></a>选项说明</p>
</th>
<th class="cellrowborder" valign="top" width="34.89%" id="mcps1.2.5.1.4"><p id="zh-cn_topic_0182200849_p15693173814112"><a name="zh-cn_topic_0182200849_p15693173814112"></a><a name="zh-cn_topic_0182200849_p15693173814112"></a>参数说明</p>
</th>
</tr>
</thead>
<tbody><tr id="zh-cn_topic_0182200849_row12693163810415"><td class="cellrowborder" valign="top" width="16.150000000000002%" headers="mcps1.2.5.1.1 "><p id="zh-cn_topic_0182200849_p14909923205818"><a name="zh-cn_topic_0182200849_p14909923205818"></a><a name="zh-cn_topic_0182200849_p14909923205818"></a>add-path</p>
</td>
<td class="cellrowborder" valign="top" width="25.77%" headers="mcps1.2.5.1.2 "><p id="zh-cn_topic_0182200849_p01201939112820"><a name="zh-cn_topic_0182200849_p01201939112820"></a><a name="zh-cn_topic_0182200849_p01201939112820"></a>将宿主机文件/目录添加到容器中。</p>
</td>
<td class="cellrowborder" valign="top" width="23.189999999999998%" headers="mcps1.2.5.1.3 "><p id="zh-cn_topic_0182200849_p1621713152471"><a name="zh-cn_topic_0182200849_p1621713152471"></a><a name="zh-cn_topic_0182200849_p1621713152471"></a></p>
</td>
<td class="cellrowborder" valign="top" width="34.89%" headers="mcps1.2.5.1.4 "><p id="zh-cn_topic_0182200849_p126791042135812"><a name="zh-cn_topic_0182200849_p126791042135812"></a><a name="zh-cn_topic_0182200849_p126791042135812"></a>参数格式为:</p>
<p id="zh-cn_topic_0182200849_p5200195110493"><a name="zh-cn_topic_0182200849_p5200195110493"></a><a name="zh-cn_topic_0182200849_p5200195110493"></a>hostpath:containerpath:permission [hostpath:containerpath:permission ...]</p>
<p id="zh-cn_topic_0182200849_p48182532492"><a name="zh-cn_topic_0182200849_p48182532492"></a><a name="zh-cn_topic_0182200849_p48182532492"></a>其中:</p>
<p id="zh-cn_topic_0182200849_p155511013165316"><a name="zh-cn_topic_0182200849_p155511013165316"></a><a name="zh-cn_topic_0182200849_p155511013165316"></a>hostdevice:卷在主机上的路径。</p>
<p id="zh-cn_topic_0182200849_p11101757155310"><a name="zh-cn_topic_0182200849_p11101757155310"></a><a name="zh-cn_topic_0182200849_p11101757155310"></a>containerdevice:卷在容器中的路径。</p>
<p id="zh-cn_topic_0182200849_p1918318113541"><a name="zh-cn_topic_0182200849_p1918318113541"></a><a name="zh-cn_topic_0182200849_p1918318113541"></a>permission:容器内对挂载路径的操作权限。</p>
</td>
</tr>
<tr id="zh-cn_topic_0182200849_row12634059013"><td class="cellrowborder" valign="top" width="16.150000000000002%" headers="mcps1.2.5.1.1 "><p id="zh-cn_topic_0182200849_p17486195414355"><a name="zh-cn_topic_0182200849_p17486195414355"></a><a name="zh-cn_topic_0182200849_p17486195414355"></a>remove-path</p>
</td>
<td class="cellrowborder" valign="top" width="25.77%" headers="mcps1.2.5.1.2 "><p id="zh-cn_topic_0182200849_p859584810286"><a name="zh-cn_topic_0182200849_p859584810286"></a><a name="zh-cn_topic_0182200849_p859584810286"></a>将容器中的目录/文件删除,还原到宿主机中。</p>
</td>
<td class="cellrowborder" valign="top" width="23.189999999999998%" headers="mcps1.2.5.1.3 "><p id="zh-cn_topic_0182200849_p11217181544713"><a name="zh-cn_topic_0182200849_p11217181544713"></a><a name="zh-cn_topic_0182200849_p11217181544713"></a></p>
</td>
<td class="cellrowborder" valign="top" width="34.89%" headers="mcps1.2.5.1.4 "><p id="zh-cn_topic_0182200849_p9642651372"><a name="zh-cn_topic_0182200849_p9642651372"></a><a name="zh-cn_topic_0182200849_p9642651372"></a>参数格式为:hostpath:containerpath [hostpath:containerpath ...]</p>
<p id="zh-cn_topic_0182200849_p17293751135113"><a name="zh-cn_topic_0182200849_p17293751135113"></a><a name="zh-cn_topic_0182200849_p17293751135113"></a>其中:</p>
<p id="zh-cn_topic_0182200849_p192934514511"><a name="zh-cn_topic_0182200849_p192934514511"></a><a name="zh-cn_topic_0182200849_p192934514511"></a>hostdevice:卷在主机上的路径。</p>
<p id="zh-cn_topic_0182200849_p132932051165117"><a name="zh-cn_topic_0182200849_p132932051165117"></a><a name="zh-cn_topic_0182200849_p132932051165117"></a>containerdevice:卷在容器中的路径。</p>
</td>
</tr>
<tr id="zh-cn_topic_0182200849_row915811441301"><td class="cellrowborder" valign="top" width="16.150000000000002%" headers="mcps1.2.5.1.1 "><p id="zh-cn_topic_0182200849_p1703322145914"><a name="zh-cn_topic_0182200849_p1703322145914"></a><a name="zh-cn_topic_0182200849_p1703322145914"></a>list-path</p>
</td>
<td class="cellrowborder" valign="top" width="25.77%" headers="mcps1.2.5.1.2 "><p id="zh-cn_topic_0182200849_p89515512813"><a name="zh-cn_topic_0182200849_p89515512813"></a><a name="zh-cn_topic_0182200849_p89515512813"></a>列出容器中所有的path目录。</p>
</td>
<td class="cellrowborder" valign="top" width="23.189999999999998%" headers="mcps1.2.5.1.3 "><p id="zh-cn_topic_0182200849_p421751513476"><a name="zh-cn_topic_0182200849_p421751513476"></a><a name="zh-cn_topic_0182200849_p421751513476"></a>支持的选项如下:</p>
<p id="zh-cn_topic_0182200849_p2073501695211"><a name="zh-cn_topic_0182200849_p2073501695211"></a><a name="zh-cn_topic_0182200849_p2073501695211"></a>--pretty:按照json格式输出。</p>
</td>
<td class="cellrowborder" valign="top" width="34.89%" headers="mcps1.2.5.1.4 "><p id="zh-cn_topic_0182200849_p1915580203514"><a name="zh-cn_topic_0182200849_p1915580203514"></a><a name="zh-cn_topic_0182200849_p1915580203514"></a></p>
</td>
</tr>
</tbody>
<table><thead align="left"><tr id="zh-cn_topic_0182200849_row1569373816419"><th class="cellrowborder" valign="top" width="16.150000000000002%" id="mcps1.2.5.1.1"><p id="zh-cn_topic_0182200849_p106936387415"><a name="zh-cn_topic_0182200849_p106936387415"></a><a name="zh-cn_topic_0182200849_p106936387415"></a>命令</p>
</th>
<th class="cellrowborder" valign="top" width="25.77%" id="mcps1.2.5.1.2"><p id="zh-cn_topic_0182200849_p43193341215"><a name="zh-cn_topic_0182200849_p43193341215"></a><a name="zh-cn_topic_0182200849_p43193341215"></a>功能说明</p>
</th>
<th class="cellrowborder" valign="top" width="23.189999999999998%" id="mcps1.2.5.1.3"><p id="zh-cn_topic_0182200849_p11217215104712"><a name="zh-cn_topic_0182200849_p11217215104712"></a><a name="zh-cn_topic_0182200849_p11217215104712"></a>选项说明</p>
</th>
<th class="cellrowborder" valign="top" width="34.89%" id="mcps1.2.5.1.4"><p id="zh-cn_topic_0182200849_p15693173814112"><a name="zh-cn_topic_0182200849_p15693173814112"></a><a name="zh-cn_topic_0182200849_p15693173814112"></a>参数说明</p>
</th>
</tr>
</thead>
<tbody><tr id="zh-cn_topic_0182200849_row12693163810415"><td class="cellrowborder" valign="top" width="16.150000000000002%" headers="mcps1.2.5.1.1 "><p id="zh-cn_topic_0182200849_p14909923205818"><a name="zh-cn_topic_0182200849_p14909923205818"></a><a name="zh-cn_topic_0182200849_p14909923205818"></a>add-path</p>
</td>
<td class="cellrowborder" valign="top" width="25.77%" headers="mcps1.2.5.1.2 "><p id="zh-cn_topic_0182200849_p01201939112820"><a name="zh-cn_topic_0182200849_p01201939112820"></a><a name="zh-cn_topic_0182200849_p01201939112820"></a>将宿主机文件/目录添加到容器中。</p>
</td>
<td class="cellrowborder" valign="top" width="23.189999999999998%" headers="mcps1.2.5.1.3 "><p id="zh-cn_topic_0182200849_p1621713152471"><a name="zh-cn_topic_0182200849_p1621713152471"></a><a name="zh-cn_topic_0182200849_p1621713152471"></a></p>
</td>
<td class="cellrowborder" valign="top" width="34.89%" headers="mcps1.2.5.1.4 "><p id="zh-cn_topic_0182200849_p126791042135812"><a name="zh-cn_topic_0182200849_p126791042135812"></a><a name="zh-cn_topic_0182200849_p126791042135812"></a>参数格式为:</p>
<p id="zh-cn_topic_0182200849_p5200195110493"><a name="zh-cn_topic_0182200849_p5200195110493"></a><a name="zh-cn_topic_0182200849_p5200195110493"></a>hostpath:containerpath:permission [hostpath:containerpath:permission ...]</p>
<p id="zh-cn_topic_0182200849_p48182532492"><a name="zh-cn_topic_0182200849_p48182532492"></a><a name="zh-cn_topic_0182200849_p48182532492"></a>其中:</p>
<p id="zh-cn_topic_0182200849_p155511013165316"><a name="zh-cn_topic_0182200849_p155511013165316"></a><a name="zh-cn_topic_0182200849_p155511013165316"></a>hostdevice:卷在主机上的路径。</p>
<p id="zh-cn_topic_0182200849_p11101757155310"><a name="zh-cn_topic_0182200849_p11101757155310"></a><a name="zh-cn_topic_0182200849_p11101757155310"></a>containerdevice:卷在容器中的路径。</p>
<p id="zh-cn_topic_0182200849_p1918318113541"><a name="zh-cn_topic_0182200849_p1918318113541"></a><a name="zh-cn_topic_0182200849_p1918318113541"></a>permission:容器内对挂载路径的操作权限。</p>
</td>
</tr>
<tr id="zh-cn_topic_0182200849_row12634059013"><td class="cellrowborder" valign="top" width="16.150000000000002%" headers="mcps1.2.5.1.1 "><p id="zh-cn_topic_0182200849_p17486195414355"><a name="zh-cn_topic_0182200849_p17486195414355"></a><a name="zh-cn_topic_0182200849_p17486195414355"></a>remove-path</p>
</td>
<td class="cellrowborder" valign="top" width="25.77%" headers="mcps1.2.5.1.2 "><p id="zh-cn_topic_0182200849_p859584810286"><a name="zh-cn_topic_0182200849_p859584810286"></a><a name="zh-cn_topic_0182200849_p859584810286"></a>将容器中的目录/文件删除,还原到宿主机中。</p>
</td>
<td class="cellrowborder" valign="top" width="23.189999999999998%" headers="mcps1.2.5.1.3 "><p id="zh-cn_topic_0182200849_p11217181544713"><a name="zh-cn_topic_0182200849_p11217181544713"></a><a name="zh-cn_topic_0182200849_p11217181544713"></a></p>
</td>
<td class="cellrowborder" valign="top" width="34.89%" headers="mcps1.2.5.1.4 "><p id="zh-cn_topic_0182200849_p9642651372"><a name="zh-cn_topic_0182200849_p9642651372"></a><a name="zh-cn_topic_0182200849_p9642651372"></a>参数格式为:hostpath:containerpath [hostpath:containerpath ...]</p>
<p id="zh-cn_topic_0182200849_p17293751135113"><a name="zh-cn_topic_0182200849_p17293751135113"></a><a name="zh-cn_topic_0182200849_p17293751135113"></a>其中:</p>
<p id="zh-cn_topic_0182200849_p192934514511"><a name="zh-cn_topic_0182200849_p192934514511"></a><a name="zh-cn_topic_0182200849_p192934514511"></a>hostdevice:卷在主机上的路径。</p>
<p id="zh-cn_topic_0182200849_p132932051165117"><a name="zh-cn_topic_0182200849_p132932051165117"></a><a name="zh-cn_topic_0182200849_p132932051165117"></a>containerdevice:卷在容器中的路径。</p>
</td>
</tr>
<tr id="zh-cn_topic_0182200849_row915811441301"><td class="cellrowborder" valign="top" width="16.150000000000002%" headers="mcps1.2.5.1.1 "><p id="zh-cn_topic_0182200849_p1703322145914"><a name="zh-cn_topic_0182200849_p1703322145914"></a><a name="zh-cn_topic_0182200849_p1703322145914"></a>list-path</p>
</td>
<td class="cellrowborder" valign="top" width="25.77%" headers="mcps1.2.5.1.2 "><p id="zh-cn_topic_0182200849_p89515512813"><a name="zh-cn_topic_0182200849_p89515512813"></a><a name="zh-cn_topic_0182200849_p89515512813"></a>列出容器中所有的path目录。</p>
</td>
<td class="cellrowborder" valign="top" width="23.189999999999998%" headers="mcps1.2.5.1.3 "><p id="zh-cn_topic_0182200849_p421751513476"><a name="zh-cn_topic_0182200849_p421751513476"></a><a name="zh-cn_topic_0182200849_p421751513476"></a>支持的选项如下:</p>
<p id="zh-cn_topic_0182200849_p2073501695211"><a name="zh-cn_topic_0182200849_p2073501695211"></a><a name="zh-cn_topic_0182200849_p2073501695211"></a>--pretty:按照json格式输出。</p>
</td>
<td class="cellrowborder" valign="top" width="34.89%" headers="mcps1.2.5.1.4 "><p id="zh-cn_topic_0182200849_p1915580203514"><a name="zh-cn_topic_0182200849_p1915580203514"></a><a name="zh-cn_topic_0182200849_p1915580203514"></a></p>
</td>
</tr>
</tbody>
</table>
## 约束限制<a name="zh-cn_topic_0182200849_section11674155610"></a>
......@@ -83,18 +83,18 @@ ARG:命令对应的参数。
## 使用示例<a name="zh-cn_topic_0182200849_section1217704995514"></a>
- 启动一个系统容器,指定hook spec为docker hook执行配置脚本:
- 启动一个系统容器,指定hook spec为isulad hook执行配置脚本:
```
[root@localhost ~]# lcrc run -tid --hook-spec /etc/docker-tools/hookspec.json --system-container --external-rootfs /root/root-fs none init
[root@localhost ~]# lcrc run -tid --hook-spec /etc/isulad-tools/hookspec.json --system-container --external-rootfs /root/root-fs none init
e45970a522d1ea0e9cfe382c2b868d92e7b6a55be1dd239947dda1ee55f3c7f7
```
- docker-tools将宿主机某个目录挂载到容器,实现资源共享:
- isulad-tools将宿主机某个目录挂载到容器,实现资源共享:
```
[root@localhost ~]# docker-tools add-path e45970a522d1 /home/test123:/home/test123
[root@localhost ~]# isulad-tools add-path e45970a522d1 /home/test123:/home/test123
Add path (/home/test123) to container(e45970a522d1,/home/test123) done.
```
......@@ -107,10 +107,10 @@ ARG:命令对应的参数。
hello world
```
- docker-tools将挂载目录从容器内删除:
- isulad-tools将挂载目录从容器内删除:
```
[root@localhost ~]# docker-tools remove-path e45970a522d1 /home/test123:/home/test123
[root@localhost ~]# isulad-tools remove-path e45970a522d1 /home/test123:/home/test123
Remove path (/home/test123) from container(e45970a522d1,/home/test123) done
[root@localhost ~]# lcrc exec e45970a522d1 bash
[root@localhost /]# ls /home/test123/helloworld
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册