This commit is contained in:
fofolee
2019-04-08 23:22:26 +08:00
commit 7ca94f1141
5960 changed files with 530244 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
<h1>Docker commit 命令</h1>
<p><strong>docker commit :</strong>从容器创建一个新的镜像。</p>
<h3>语法</h3>
<pre>docker commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]]</pre>
<p>OPTIONS说明</p>
<ul>
<li><p><strong>-a :</strong>提交的镜像作者;</p><p></p></li>
<li><p><strong>-c :</strong>使用Dockerfile指令来创建镜像</p><p></p></li>
<li><p><strong>-m :</strong>提交时的说明文字;</p><p></p></li>
<li><p><strong>-p :</strong>在commit时将容器暂停。</p><p></p></li>
</ul>
<h3>实例</h3>
<p>将容器a404c6c174a2 保存为新的镜像,并添加提交人信息和说明信息。</p>
<pre>runoob@runoob:~$ docker commit -a "runoob.com" -m "my apache" a404c6c174a2 mymysql:v1
sha256:37af1236adef1544e8886be23010b66577647a40bc02c0885a6600b33ee28057
runoob@runoob:~$ docker images mymysql:v1
REPOSITORY TAG IMAGE ID CREATED SIZE
mymysql v1 37af1236adef 15 seconds ago 329 MB
</pre>