github.com/pwn-term/docker@v0.0.0-20210616085119-6e977cce2565/cli/docs/reference/commandline/push.md (about) 1 --- 2 title: "push" 3 description: "The push command description and usage" 4 keywords: "share, push, image" 5 --- 6 7 # push 8 9 ```markdown 10 Usage: docker push [OPTIONS] NAME[:TAG] 11 12 Push an image or a repository to a registry 13 14 Options: 15 -a, --all-tags Push all tagged images in the repository 16 --disable-content-trust Skip image signing (default true) 17 --help Print usage 18 -q, --quiet Suppress verbose output 19 ``` 20 21 ## Description 22 23 Use `docker image push` to share your images to the [Docker Hub](https://hub.docker.com) 24 registry or to a self-hosted one. 25 26 Refer to the [`docker image tag`](tag.md) reference for more information about valid 27 image and tag names. 28 29 Killing the `docker image push` process, for example by pressing `CTRL-c` while it is 30 running in a terminal, terminates the push operation. 31 32 Progress bars are shown during docker push, which show the uncompressed size. 33 The actual amount of data that's pushed will be compressed before sending, so 34 the uploaded size will not be reflected by the progress bar. 35 36 Registry credentials are managed by [docker login](login.md). 37 38 ### Concurrent uploads 39 40 By default the Docker daemon will push five layers of an image at a time. 41 If you are on a low bandwidth connection this may cause timeout issues and you may want to lower 42 this via the `--max-concurrent-uploads` daemon option. See the 43 [daemon documentation](dockerd.md) for more details. 44 45 ## Examples 46 47 ### Push a new image to a registry 48 49 First save the new image by finding the container ID (using [`docker container ls`](ps.md)) 50 and then committing it to a new image name. Note that only `a-z0-9-_.` are 51 allowed when naming images: 52 53 ```bash 54 $ docker container commit c16378f943fe rhel-httpd:latest 55 ``` 56 57 Now, push the image to the registry using the image ID. In this example the 58 registry is on host named `registry-host` and listening on port `5000`. To do 59 this, tag the image with the host name or IP address, and the port of the 60 registry: 61 62 ```bash 63 $ docker image tag rhel-httpd:latest registry-host:5000/myadmin/rhel-httpd:latest 64 65 $ docker image push registry-host:5000/myadmin/rhel-httpd:latest 66 ``` 67 68 Check that this worked by running: 69 70 ```bash 71 $ docker image ls 72 ``` 73 74 You should see both `rhel-httpd` and `registry-host:5000/myadmin/rhel-httpd` 75 listed. 76 77 ### Push all tags of an image 78 79 Use the `-a` (or `--all-tags`) option to push To push all tags of a local image. 80 81 The following example creates multiple tags for an image, and pushes all those 82 tags to Docker Hub. 83 84 85 ```bash 86 $ docker image tag myimage registry-host:5000/myname/myimage:latest 87 $ docker image tag myimage registry-host:5000/myname/myimage:v1.0.1 88 $ docker image tag myimage registry-host:5000/myname/myimage:v1.0 89 $ docker image tag myimage registry-host:5000/myname/myimage:v1 90 ``` 91 92 The image is now tagged under multiple names: 93 94 ```bash 95 $ docker image ls 96 97 REPOSITORY TAG IMAGE ID CREATED SIZE 98 myimage latest 6d5fcfe5ff17 2 hours ago 1.22MB 99 registry-host:5000/myname/myimage latest 6d5fcfe5ff17 2 hours ago 1.22MB 100 registry-host:5000/myname/myimage v1 6d5fcfe5ff17 2 hours ago 1.22MB 101 registry-host:5000/myname/myimage v1.0 6d5fcfe5ff17 2 hours ago 1.22MB 102 registry-host:5000/myname/myimage v1.0.1 6d5fcfe5ff17 2 hours ago 1.22MB 103 ``` 104 105 When pushing with the `--all-tags` option, all tags of the `registry-host:5000/myname/myimage` 106 image are pushed: 107 108 109 ```bash 110 $ docker image push --all-tags registry-host:5000/myname/myimage 111 112 The push refers to repository [registry-host:5000/myname/myimage] 113 195be5f8be1d: Pushed 114 latest: digest: sha256:edafc0a0fb057813850d1ba44014914ca02d671ae247107ca70c94db686e7de6 size: 4527 115 195be5f8be1d: Layer already exists 116 v1: digest: sha256:edafc0a0fb057813850d1ba44014914ca02d671ae247107ca70c94db686e7de6 size: 4527 117 195be5f8be1d: Layer already exists 118 v1.0: digest: sha256:edafc0a0fb057813850d1ba44014914ca02d671ae247107ca70c94db686e7de6 size: 4527 119 195be5f8be1d: Layer already exists 120 v1.0.1: digest: sha256:edafc0a0fb057813850d1ba44014914ca02d671ae247107ca70c94db686e7de6 size: 4527 121 ``` 122