Home  >  Article  >  Operation and Maintenance  >  How docker packages containers into images

How docker packages containers into images

王林
王林Original
2020-03-24 15:38:0614820browse

How docker packages containers into images

This can be done using the docker commit command. Docker commit can create a new image from the container.

Syntax format:

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

Parameter description;

-a: Submitted image author;

-c: Use Dockerfile instructions to create the image;

-m: Description text when submitting;

-p: Pause the container when committing

(recommended tutorial: docker tutorial)

Example:

Save the container a404c6c174a2 as a new image, and add the submitter information and description information.

runoob@runoob:~$ docker commit -a "runoob.com" -m "my apache" a404c6c174a2  mymysql:v1 
sha256:37af1236adef1544e8886be23010b66577647a40bc02c0885a6600b33ee28057runoob@runoob:~$ docker images mymysql:v1
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
mymysql             v1                  37af1236adef        15 seconds ago      329 MB

The above is the detailed content of How docker packages containers into images. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn