Image

Image by Hessel Visser from Pixabay
Container images are the foundations that containers run on. Containers are deployed from images, so any application that needs to run in a container must be created first as an image.
Developers or administrators have two options when deploying containerized applications. The developer either builds the image or pulls it from a public repository (such as Quay.io, registry.access.redhat.com, Docker.io, or similar). Some companies also deploy private registries to centrally store custom images built by administrators and developers.
[ Getting started with containers? Check out this free online course: Running containers with Red Hat. ]
You can use Podman to manage images and containers. The podman images
command lists the images that are available on a server:
$ podman images
REPOSITORY TAG IMAGE ID CREATED SIZE
docker.io/library/redis latest 0e403e3816e8 3 days 116 MB
docker.io/library/mysql latest c1558761f285 4 days 525 MB
docker.io/library/nginx latest c919045c4c2b 5 days 146 MB
registry.access.redhat.com/ubi8/ubi 8.5-[...]52de1277b39 9 days 235 MB
registry.access.redhat.com/ubi8/ubi latest 52de04277b39 9 days 235 MB
quay.io/centos7/mysql-80-centos7 latest 06552cd3c0b0 2 weeks 521 MB
You can deploy containers based on the images listed because they're locally accessible. It's also possible to deploy containers based on images not locally accessible because Podman can pull an image from a repository before it's needed. But what do you do when an image isn't available locally or remotely?
You may not have permission or an internet connection to download an image from a public repository in some restricted environments. In that case, you need a private repository as your source of container images. In situations where private repositories are also not available, Podman offers a save
command so that you can make an existing image available to your other servers.
The podman save
command saves an image to an archive, making it available to be loaded on another server. For instance, to save a group of images on a host named servera
:
[servera]$ podman save --output images.tar \
docker.io/library/redis \
docker.io/library/mysql \
registry.access.redhat.com/ubi8/ubi \
registry.access.redhat.com/ubi8/ubi:8.5-226.1645809065 \
quay.io/centos7/mysql-80-centos7 docker.io/library/nginx
The --output
option (-o
for short) specifies an output file (images.tar
in this example). You can list the images you want to save by image name or by image ID.
At the time of writing, only the Docker container format supports saving multiple images, although it's a developing feature in the Open Container Initiative (OCI) format.
Once complete, you can take the file images.tar
to serverb
and load it with podman load
:
[serverb]$ podman load --input images.tar
You can verify that the images are available by running the podman images
command:
$ podman images
REPOSITORY TAG IMAGE ID CREATED SIZE
docker.io/library/redis latest 0e403e3816e8 3 days 116 MB
docker.io/library/mysql latest c1558761f285 4 days 525 MB
docker.io/library/nginx latest c919045c4c2b 5 days 146 MB
registry.access.redhat.com/ubi8/ubi 8.5-[...]52de1277b39 9 days 235 MB
registry.access.redhat.com/ubi8/ubi latest 52de04277b39 9 days 235 MB
quay.io/centos7/mysql-80-centos7 latest 06552cd3c0b0 2 weeks 521 MB
It is generally recommended to use a public or private repository to store images, as this is easy to manage. And there are several other tools that focus exclusively on image transport for moving a large number of images. However, for a few images or in situations where other options aren't available, the podman save
and podman load
commands allow you to share images across multiple servers and systems.
I work as Unix/Linux Administrator with a passion for high availability systems and clusters. I am a student of performance and optimization of systems and DevOps. I have passion for anything IT related and most importantly automation, high availability, and security. More about me