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

How docker packages containers into images

王林
Release: 2020-03-24 15:38:06
Original
14894 people have browsed it

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]]
Copy after login

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
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Latest Issues
About docker
From 1970-01-01 08:00:00
0
0
0
docker install phpstudy
From 1970-01-01 08:00:00
0
0
0
Deploy snmp environment in docker
From 1970-01-01 08:00:00
0
0
0
docker pull error?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template