2016-10-14 18:30:36 -04:00
|
|
|
---
|
|
|
|
title: "push"
|
|
|
|
description: "The push command description and usage"
|
2016-11-03 18:48:30 -04:00
|
|
|
keywords: "share, push, image"
|
2016-10-14 18:30:36 -04:00
|
|
|
---
|
2015-06-21 16:41:38 -04:00
|
|
|
|
2017-07-28 13:28:23 -04:00
|
|
|
<!-- This file is maintained within the docker/cli Github
|
|
|
|
repository at https://github.com/docker/cli/. Make all
|
2016-10-19 13:25:45 -04:00
|
|
|
pull requests against that repo. If you see this file in
|
|
|
|
another repository, consider it read-only there, as it will
|
|
|
|
periodically be overwritten by the definitive file. Pull
|
|
|
|
requests which include edits to this file in other repositories
|
|
|
|
will be rejected.
|
|
|
|
-->
|
|
|
|
|
2015-06-21 16:41:38 -04:00
|
|
|
# push
|
|
|
|
|
2016-07-07 14:43:18 -04:00
|
|
|
```markdown
|
|
|
|
Usage: docker push [OPTIONS] NAME[:TAG]
|
2015-06-21 16:41:38 -04:00
|
|
|
|
2016-07-07 14:43:18 -04:00
|
|
|
Push an image or a repository to a registry
|
2015-06-21 16:41:38 -04:00
|
|
|
|
2016-07-07 14:43:18 -04:00
|
|
|
Options:
|
2017-01-17 09:46:07 -05:00
|
|
|
--disable-content-trust Skip image signing (default true)
|
2016-07-07 14:43:18 -04:00
|
|
|
--help Print usage
|
|
|
|
```
|
2015-07-07 23:14:47 -04:00
|
|
|
|
2017-02-07 18:42:48 -05:00
|
|
|
## Description
|
|
|
|
|
2015-06-21 16:41:38 -04:00
|
|
|
Use `docker push` to share your images to the [Docker Hub](https://hub.docker.com)
|
|
|
|
registry or to a self-hosted one.
|
2016-09-15 12:53:46 -04:00
|
|
|
|
|
|
|
Refer to the [`docker tag`](tag.md) reference for more information about valid
|
|
|
|
image and tag names.
|
2015-12-09 14:26:07 -05:00
|
|
|
|
|
|
|
Killing the `docker push` process, for example by pressing `CTRL-c` while it is
|
2016-09-15 12:53:46 -04:00
|
|
|
running in a terminal, terminates the push operation.
|
2016-03-28 20:10:11 -04:00
|
|
|
|
2017-03-24 10:25:52 -04:00
|
|
|
Progress bars are shown during docker push, which show the uncompressed size. The
|
|
|
|
actual amount of data that's pushed will be compressed before sending, so the uploaded
|
|
|
|
size will not be reflected by the progress bar.
|
|
|
|
|
2016-03-28 20:10:11 -04:00
|
|
|
Registry credentials are managed by [docker login](login.md).
|
2016-09-15 12:53:46 -04:00
|
|
|
|
2017-02-07 18:42:48 -05:00
|
|
|
### Concurrent uploads
|
2016-11-22 16:24:37 -05:00
|
|
|
|
|
|
|
By default the Docker daemon will push five layers of an image at a time.
|
|
|
|
If you are on a low bandwidth connection this may cause timeout issues and you may want to lower
|
|
|
|
this via the `--max-concurrent-uploads` daemon option. See the
|
|
|
|
[daemon documentation](dockerd.md) for more details.
|
|
|
|
|
2016-09-17 23:00:19 -04:00
|
|
|
## Examples
|
2016-09-15 12:53:46 -04:00
|
|
|
|
2017-02-07 18:42:48 -05:00
|
|
|
### Push a new image to a registry
|
2016-09-15 12:53:46 -04:00
|
|
|
|
|
|
|
First save the new image by finding the container ID (using [`docker ps`](ps.md))
|
|
|
|
and then committing it to a new image name. Note that only `a-z0-9-_.` are
|
|
|
|
allowed when naming images:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ docker commit c16378f943fe rhel-httpd
|
|
|
|
```
|
|
|
|
|
|
|
|
Now, push the image to the registry using the image ID. In this example the
|
|
|
|
registry is on host named `registry-host` and listening on port `5000`. To do
|
|
|
|
this, tag the image with the host name or IP address, and the port of the
|
|
|
|
registry:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ docker tag rhel-httpd registry-host:5000/myadmin/rhel-httpd
|
2017-02-07 18:42:48 -05:00
|
|
|
|
2016-09-15 12:53:46 -04:00
|
|
|
$ docker push registry-host:5000/myadmin/rhel-httpd
|
|
|
|
```
|
|
|
|
|
|
|
|
Check that this worked by running:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ docker images
|
|
|
|
```
|
|
|
|
|
|
|
|
You should see both `rhel-httpd` and `registry-host:5000/myadmin/rhel-httpd`
|
|
|
|
listed.
|