Commandes Linux : docker container commit


Commande : docker container commit
Usage:	docker container commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]]

Create a new image from a container's changes

  -a, --author string    Author (e.g., "John Hannibal Smith ")
  -c, --change list      Apply Dockerfile instruction to the created image
  -m, --message string   Commit message
  -p, --pause            Pause container during commit (default true)


Commiter un container pour générer une image en vue d’un push :

docker container commit [-p] [-m "message"] src-container dst-image

L’option -p met en pause le container durant le commit, l’option -m définit un message de commit.
Equivaut à :
docker commit [-p] [-m "message"] src-container dst-image
ex :

$ docker commit -p -m "Initial commit v1.0" web_server darwinos/repotest:web_server-v1.0
$ docker push darwinos/repotest:web_server-v1.0
The push refers to repository []
0a8166724d0c: Pushed 
f12c6cf07176: Mounted from library/nginx 
341dde1390a8: Mounted from library/nginx 
9c46f426bcb7: Mounted from library/nginx 
web_server-v1.0: digest: sha256:94c8c9e02f97ddc1fcd1000297415a0c0164068d924e36452c32cf930b02dbde size: 1155