.nh .TH "DOCKER" "1" "May 2022" "Docker Community" "Docker User Manuals" .SH NAME .PP docker\-image\-push \- Push an image or a repository to a registry .SH SYNOPSIS .PP \fBdocker image push [OPTIONS] NAME[:TAG]\fP .SH DESCRIPTION .PP Use \fB\fCdocker image push\fR to share your images to the Docker Hub \[la]https://hub.docker.com\[ra] registry or to a self\-hosted one. .PP Refer to \fBdocker\-image\-tag(1)\fP for more information about valid image and tag names. .PP Killing the \fBdocker image push\fP process, for example by pressing \fBCTRL\-c\fP while it is running in a terminal, terminates the push operation. .PP Registry credentials are managed by \fBdocker\-login(1)\fP\&. .SH EXAMPLES .SH Pushing a new image to a registry .PP First save the new image by finding the container ID (using \fBdocker container ls\fP) and then committing it to a new image name. Note that only a\-z0\-9\-\_. are allowed when naming images: .PP .RS .nf # docker container commit c16378f943fe rhel\-httpd .fi .RE .PP Now, push the image to the registry using the image ID. In this example the registry is on host named \fB\fCregistry\-host\fR and listening on port \fB\fC5000\fR\&. To do this, tag the image with the host name or IP address, and the port of the registry: .PP .RS .nf # docker image tag rhel\-httpd registry\-host:5000/myadmin/rhel\-httpd:latest # docker image push registry\-host:5000/myadmin/rhel\-httpd:latest .fi .RE .PP Check that this worked by running: .PP .RS .nf # docker image ls .fi .RE .PP You should see both \fB\fCrhel\-httpd\fR and \fB\fCregistry\-host:5000/myadmin/rhel\-httpd\fR listed. .SS Push all tags of an image .PP Use the \fB\fC\-a\fR (or \fB\fC\-\-all\-tags\fR) option to push To push all tags of a local image. .PP The following example creates multiple tags for an image, and pushes all those tags to Docker Hub. .PP .RS .nf $ docker image tag myimage registry\-host:5000/myname/myimage:latest $ docker image tag myimage registry\-host:5000/myname/myimage:v1.0.1 $ docker image tag myimage registry\-host:5000/myname/myimage:v1.0 $ docker image tag myimage registry\-host:5000/myname/myimage:v1 .fi .RE .PP The image is now tagged under multiple names: .PP .RS .nf $ docker image ls REPOSITORY TAG IMAGE ID CREATED SIZE myimage latest 6d5fcfe5ff17 2 hours ago 1.22MB registry\-host:5000/myname/myimage latest 6d5fcfe5ff17 2 hours ago 1.22MB registry\-host:5000/myname/myimage v1 6d5fcfe5ff17 2 hours ago 1.22MB registry\-host:5000/myname/myimage v1.0 6d5fcfe5ff17 2 hours ago 1.22MB registry\-host:5000/myname/myimage v1.0.1 6d5fcfe5ff17 2 hours ago 1.22MB .fi .RE .PP When pushing with the \fB\fC\-\-all\-tags\fR option, all tags of the \fB\fCregistry\-host:5000/myname/myimage\fR image are pushed: .PP .RS .nf $ docker image push \-\-all\-tags registry\-host:5000/myname/myimage The push refers to repository [registry\-host:5000/myname/myimage] 195be5f8be1d: Pushed latest: digest: sha256:edafc0a0fb057813850d1ba44014914ca02d671ae247107ca70c94db686e7de6 size: 4527 195be5f8be1d: Layer already exists v1: digest: sha256:edafc0a0fb057813850d1ba44014914ca02d671ae247107ca70c94db686e7de6 size: 4527 195be5f8be1d: Layer already exists v1.0: digest: sha256:edafc0a0fb057813850d1ba44014914ca02d671ae247107ca70c94db686e7de6 size: 4527 195be5f8be1d: Layer already exists v1.0.1: digest: sha256:edafc0a0fb057813850d1ba44014914ca02d671ae247107ca70c94db686e7de6 size: 4527 .fi .RE .SH OPTIONS .PP \fB\-a\fP, \fB\-\-all\-tags\fP[=false] Push all tagged images in the repository .PP \fB\-\-disable\-content\-trust\fP[=true] Skip image signing .PP \fB\-h\fP, \fB\-\-help\fP[=false] help for push .PP \fB\-q\fP, \fB\-\-quiet\fP[=false] Suppress verbose output .SH SEE ALSO .PP \fBdocker\-image(1)\fP