Commandes Linux : docker container commit

DOCKER CONTAINER COMMIT

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

Create a new image from a container's changes

Options:
  -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 :
Exécuter un ping en foreground sur le container nommé test :

$ docker commit -p -m "Initial commit v1.0" web_server darwinos/repotest:web_server-v1.0
sha256:473db7bf6771b5b246d860a5e489c3c564598921702e3c1e36e67bc4a5d44295
$ docker push darwinos/repotest:web_server-v1.0
The push refers to repository [docker.io/darwinos/repotest]
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

 

Fermer le menu
%d blogueurs aiment cette page :