2016-10-14 22:30:36 +00:00
|
|
|
---
|
|
|
|
title: "push"
|
|
|
|
description: "The push command description and usage"
|
2016-11-03 22:48:30 +00:00
|
|
|
keywords: "share, push, image"
|
2016-10-14 22:30:36 +00:00
|
|
|
---
|
2015-06-21 20:41:38 +00:00
|
|
|
|
2016-10-19 17:25:45 +00:00
|
|
|
<!-- This file is maintained within the docker/docker Github
|
|
|
|
repository at https://github.com/docker/docker/. Make all
|
|
|
|
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 20:41:38 +00:00
|
|
|
# push
|
|
|
|
|
2016-07-07 18:43:18 +00:00
|
|
|
```markdown
|
|
|
|
Usage: docker push [OPTIONS] NAME[:TAG]
|
2015-06-21 20:41:38 +00:00
|
|
|
|
2016-07-07 18:43:18 +00:00
|
|
|
Push an image or a repository to a registry
|
2015-06-21 20:41:38 +00:00
|
|
|
|
2016-07-07 18:43:18 +00:00
|
|
|
Options:
|
2017-01-17 14:46:07 +00:00
|
|
|
--disable-content-trust Skip image signing (default true)
|
2016-07-07 18:43:18 +00:00
|
|
|
--help Print usage
|
|
|
|
```
|
2015-07-08 03:14:47 +00:00
|
|
|
|
2017-02-07 23:42:48 +00:00
|
|
|
## Description
|
|
|
|
|
2015-06-21 20:41:38 +00: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 16:53:46 +00:00
|
|
|
|
|
|
|
Refer to the [`docker tag`](tag.md) reference for more information about valid
|
|
|
|
image and tag names.
|
2015-12-09 19:26:07 +00:00
|
|
|
|
|
|
|
Killing the `docker push` process, for example by pressing `CTRL-c` while it is
|
2016-09-15 16:53:46 +00:00
|
|
|
running in a terminal, terminates the push operation.
|
2016-03-29 00:10:11 +00:00
|
|
|
|
2017-03-24 14:25:52 +00: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-29 00:10:11 +00:00
|
|
|
Registry credentials are managed by [docker login](login.md).
|
2016-09-15 16:53:46 +00:00
|
|
|
|
2017-02-07 23:42:48 +00:00
|
|
|
### Concurrent uploads
|
2016-11-22 21:24:37 +00: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-18 03:00:19 +00:00
|
|
|
## Examples
|
2016-09-15 16:53:46 +00:00
|
|
|
|
2017-02-07 23:42:48 +00:00
|
|
|
### Push a new image to a registry
|
2016-09-15 16:53:46 +00: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 23:42:48 +00:00
|
|
|
|
2016-09-15 16:53:46 +00: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.
|