Home > Article > Operation and Maintenance > 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!