Skip to content
This repository has been archived by the owner on Mar 23, 2021. It is now read-only.

Commit

Permalink
docs(docker): 保存容器为镜像
Browse files Browse the repository at this point in the history
  • Loading branch information
zjZSTU committed Sep 21, 2019
1 parent 1bc27e9 commit 23f8a51
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
Binary file modified docs/docker.xmind
Binary file not shown.
1 change: 1 addition & 0 deletions docs/source/docker/basic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
basic/hello-world
basic/docker-hub使用
basic/[Ubuntu 16.04]docker启动设置
basic/[docker commit]保存容器为镜像
29 changes: 29 additions & 0 deletions docs/source/docker/basic/[docker commit]保存容器为镜像.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

# [docker commit]保存容器为镜像

保存已修改后的容器为新的镜像

## 语法

```
docker commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]]
```

* 参数`CONTAINER`指定容器`ID`
* 参数`REPOSITORY`指定新的镜像名,格式为
* 参数`TAG`指定额外标记,比如版本号

可添加额外选项,指定作者名,提交信息,是否在提交时暂停容器以及是否应用`Dockerfile`指令到创建的镜像

![](./imgs/commit-options.png)

## 示例

```
$ docker commit --author zjzstu --message "using aliyun mirrors" f8f8 zjzstu/ubuntu:18.04
sha256:5493327e7708602f5ebb0b42d638234bf47ff4ee23804d3b3a96535d4c8dcec3
$ docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
zjzstu/ubuntu 18.04 5493327e7708 19 seconds ago 109MB
```
Binary file added docs/source/docker/basic/imgs/commit-options.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 23f8a51

Please sign in to comment.