4.10. Saving and loading images
Use the podman save command to save an image to a container archive. You can restore it later to another container environment or send it to someone else. You can use --format option to specify the archive format. The supported formats are:
-
docker-archive -
oci-archive -
oci-dir(directory with oci manifest type) -
docker-archive(directory with v2s2 manifest type)
The default format is the docker-archive format.
Use the podman load command to load an image from the container image archive into the container storage.
Prerequisites
-
The
container-toolsmeta-package is installed. - A pulled image is available on the local system.
Procedure
Save the
registry.redhat.io/rhel10/support-toolsimage as a tarball:In the default
docker-archiveformat:$ podman save -o mysupport-tools.tar registry.redhat.io/rhel10/support-tools:latestIn the
oci-archiveformat, using the--formatoption:$ podman save -o mysupport-tools-oci.tar --format=oci-archive registry.redhat.io/rhel10/support-toolsThe
mysupport-tools.tarandmysupport-tools-oci.tararchives are stored in your current directory. The next steps are performed with themysupport-tools.tartarball.
Check the file type of
mysupport-tools.tar:$ file mysupport-tools.tar mysupport-tools.tar: POSIX tar archiveTo load the
registry.redhat.io/rhel10/support-tools:latestimage from themysupport-tools.tar:$ podman load -i mysupport-tools.tar ... Loaded image(s): registry.redhat.io/rhel10/support-tools:latestFor more information, see the
podman-save(1)andpodman-load(1)man pages on your system.