Allow podman push to push manifest lists

When doing a podman images, manifests lists look just like images, so
it is logical that users would assume that they can just podman push them
to a registry.  The problem is we throw out weird errors when this happens
and users need to somehow figure out this is a manifest list rather then
an image, and frankly the user will not understand the difference.

This PR will make podman push just do the right thing, by failing over and
attempting to push the manifest if it fails to push the image.

Fix up handling of manifest push

Protocol should bring back a digest string, which can either be
printed or stored in a file.

We should not reimplement the manifest push setup code in the tunnel
code but take advantage of the api path, to make sure remote and local
work the same way.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
Daniel J Walsh
2021-01-15 03:49:42 -05:00
parent 5a166b2973
commit cf51c7ed9f
20 changed files with 190 additions and 247 deletions

View File

@ -17,7 +17,7 @@ The list image's ID and the digest of the image's manifest.
#### **--all**
Push the images mentioned in the manifest list or image index, in addition to
the list or index itself.
the list or index itself. (Default true)
#### **--authfile**=*path*
@ -46,14 +46,14 @@ After copying the image, write the digest of the resulting image to the file.
Manifest list type (oci or v2s2) to use when pushing the list (default is oci).
#### **--purge**
Delete the manifest list or image index from local storage if pushing succeeds.
#### **--quiet**, **-q**
When writing the manifest, suppress progress output
#### **--rm**
Delete the manifest list or image index from local storage if pushing succeeds.
#### **--remove-signatures**
Don't copy signatures when pushing images.

View File

@ -1,7 +1,7 @@
% podman-push(1)
## NAME
podman\-push - Push an image from local storage to elsewhere
podman\-push - Push an image, manifest list or image index from local storage to elsewhere
## SYNOPSIS
**podman push** [*options*] *image* [*destination*]
@ -9,10 +9,11 @@ podman\-push - Push an image from local storage to elsewhere
**podman image push** [*options*] *image* [*destination*]
## DESCRIPTION
Pushes an image from local storage to a specified destination.
Push is mainly used to push images to registries, however **podman push**
can be used to save images to tarballs and directories using the following
transports: **dir:**, **docker-archive:**, **docker-daemon:** and **oci-archive:**.
Pushes an image, manifest list or image index from local storage to a specified
destination. Push is mainly used to push images to registries, however
**podman push** can be used to save images to tarballs and directories using the
following transports:
**dir:**, **docker-archive:**, **docker-daemon:** and **oci-archive:**.
## Image storage
Images are pushed from those stored in local image storage.

View File

@ -246,7 +246,7 @@ the exit codes follow the `chroot` standard, see below:
| [podman-port(1)](podman-port.1.md) | List port mappings for a container. |
| [podman-ps(1)](podman-ps.1.md) | Prints out information about containers. |
| [podman-pull(1)](podman-pull.1.md) | Pull an image from a registry. |
| [podman-push(1)](podman-push.1.md) | Push an image from local storage to elsewhere. |
| [podman-push(1)](podman-push.1.md) | Push an image, manifest list or image index from local storage to elsewhere.|
| [podman-rename(1)](podman-rename.1.md) | Rename an existing container. |
| [podman-restart(1)](podman-restart.1.md) | Restart one or more containers. |
| [podman-rm(1)](podman-rm.1.md) | Remove one or more containers. |