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?

Create a local image

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.

Load a saved container image

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

Flexible Podman

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.

UI_Icon-Red_Hat-Close-A-Black-RGB

채널별 검색

automation icon

오토메이션

기술, 팀, 인프라를 위한 IT 자동화 최신 동향

AI icon

인공지능

고객이 어디서나 AI 워크로드를 실행할 수 있도록 지원하는 플랫폼 업데이트

open hybrid cloud icon

오픈 하이브리드 클라우드

하이브리드 클라우드로 더욱 유연한 미래를 구축하는 방법을 알아보세요

security icon

보안

환경과 기술 전반에 걸쳐 리스크를 감소하는 방법에 대한 최신 정보

edge icon

엣지 컴퓨팅

엣지에서의 운영을 단순화하는 플랫폼 업데이트

Infrastructure icon

인프라

세계적으로 인정받은 기업용 Linux 플랫폼에 대한 최신 정보

application development icon

애플리케이션

복잡한 애플리케이션에 대한 솔루션 더 보기

Virtualization icon

가상화

온프레미스와 클라우드 환경에서 워크로드를 유연하게 운영하기 위한 엔터프라이즈 가상화의 미래