Managing Container Images Using Podman and Skopeo on RHEL

1 hour
  • 4 Learning Objectives

About this Hands-on Lab

An essential part of managing containers is working with container images. In this lab, we install and configure a Podman environment and use Podman and Skopeo to manage container images in our environment. Upon completion, you can install and configure a Podman environment and use it to manage container images.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Install Podman Using yum or Application Streams
  1. Install podman on your RHEL server using yum. Alternatively, you can use Application Streams to install the container-tools package stream.

    Note: If you use Application Streams, make sure you use the default stream.

Start the Local Container Image Registry
  1. A local container image registry has been pre-configured on your server. Before we can use it, we need to start it.
  2. Run the script (registry.sh), provided in the cloud_user home directory. Run this script with sudo, as it requires root privilages.
Manage Container Images Using Podman

The podman command comes with quite a bit of container management functionality included. Let’s try the following:

  1. Check your installed version of podman
  2. Check out the help information on the podman command
  3. Check out the help information on the podman image command
  4. Use podman to search for the ubi:latest container images
  5. Use podman to pull a copy of the registry.access.redhat.com/ubi8/ubi:latest container image
  6. Compare the podman images command to the podman image list command
  7. Compare the podman inspect ubi command to the podman image inspect ubi command
  8. Add the myubi tag to the ubi:latest image
  9. List our container images again
  10. Log in to the local container inage registry at localhost:5000
  11. Push the ubi:latest image in our local container image storage to the registry running on our lab server
    • Tag the ubi:latest image with the target of localhost:5000/ubi8/ubi
    • Push the image to localhost:5000/ubi8/ubi:latest
  12. Check the local registry’s contents using curl -u cloud_user https://localhost:5000/v2/_catalog and the cloud_user password
  13. Remove the myubi tag
  14. List our container images again
  15. Remove the image with no tags using the imageID
  16. List our container images again
  17. Use podman to search our local registry
  18. Using podman, log out of the local container registry
Manage Container Images Using Skopeo

Even though the podman command can be used to perform container image management, taking things to the next level requires skopeo. Let’s try the following with skopeo:

  1. Check your installed version of skopeo
  2. Check out the help information on the skopeo command
  3. Check out the help information on the skopeo inspect command
  4. Use skopeo to log in to the local container image registry at localhost:5000
  5. Use skopeo to copy a container image directly from docker://registry.access.redhat.com/ubi7/ubi:latest to our local registry (docker://localhost:5000/ubi7/ubi)
  6. Check the local registry’s contents using curl -u cloud_user https://localhost:5000/v2/_catalog and the cloud_user password
  7. Use skopeo to sync a container image from docker://registry.access.redhat.com/ubi7/ubi:latest to our local registry (docker://localhost:5000/ubi7/ubi)
  8. Use skopeo to inspect the ubi7 and ubi8 images on the local container registry
  9. Use skopeo to list the tags on the ubi7 and ubi8 images on the local container registry
  10. Use podman to search our local registry (localhost:5000/ubi)
  11. Use skopeo to log out of the local container image registry at localhost:5000

Additional Resources

We need to set up a Podman environment on our server and populate it with some images!

We will install Podman and bring up a container image registry running on this lab's server as localhost:5000. Afterward, we explore the container image management capabilities of the podman and skopeo commands.

The username for the local container image registry is cloud_user and the password is the password provided with the lab.

Log in to the server using the credentials provided:

ssh cloud_user@<PUBLIC_IP_ADDRESS>

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Get Started
Who’s going to be learning?

How many seats do you need?

  • $499 USD per seat per year
  • Billed Annually
  • Renews in 12 months

Ready to accelerate learning?

For over 25 licenses, a member of our sales team will walk you through a custom tailored solution for your business.


$2,495.00

Checkout
Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!