- Lab
-
Libraries: If you want this lab, consider one of these libraries.
- Cloud
Managing Container Images Using Podman and Skopeo on RHEL
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.
Lab Info
Table of Contents
-
Challenge
Install Podman Using yum or Application Streams
- Install
podmanon your RHEL server usingyum. Alternatively, you can use Application Streams to install thecontainer-toolspackage stream.
Note: If you use Application Streams, make sure you use the default stream.
2.We need to add
'localhost'to the empty line for[registries.insecure]in the/etc/containers/registries.conffile to specify our local container registry as an insecure registry. You'll need to do this usingsudo. - Install
-
Challenge
Start the Local Container Image Registry
- A local container image registry has been pre-configured on your server. Before we can use it, we need to start it.
- Run the script (
registry.sh), provided in thecloud_userhome directory. Run this script withsudo, as it requiresrootprivilages.
-
Challenge
Manage Container Images Using Podman
The
podmancommand comes with quite a bit of container management functionality included. Let's try the following:- Check your installed version of
podman - Check out the help information on the
podmancommand - Check out the help information on the
podman imagecommand - Use
podmanto search for theubi:latestcontainer images - Use
podmanto pull a copy of theregistry.access.redhat.com/ubi8/ubi:latestcontainer image - Compare the
podman imagescommand to thepodman image listcommand - Compare the
podman inspect ubicommand to thepodman image inspect ubicommand - Add the
myubitag to theubi:latestimage - List our container images again
- Log in to the local container inage registry at
localhost:5000 - Push the
ubi:latestimage in our local container image storage to the registry running on our lab server- Tag the
ubi:latestimage with the target oflocalhost:5000/ubi8/ubi - Push the image to
localhost:5000/ubi8/ubi:latest- Use the
--remove-signaturesswitch
- Use the
- Tag the
- Check the local registry's contents using
curl -u cloud_user https://localhost:5000/v2/_catalogand thecloud_userpassword - Remove the
myubitag - List our container images again
- Remove the image with no tags using the
imageID - List our container images again
- Use
podmanto search our local registry - Using
podman, log out of the local container registry
- Check your installed version of
-
Challenge
Manage Container Images Using Skopeo
Even though the
podmancommand can be used to perform container image management, taking things to the next level requiresskopeo. Let's try the following withskopeo:- Check your installed version of
skopeo - Check out the help information on the
skopeocommand - Check out the help information on the
skopeo inspectcommand - Use
skopeoto log in to the local container image registry atlocalhost:5000 - Use
skopeoto copy a container image directly fromdocker://registry.access.redhat.com/ubi7/ubi:latestto our local registry (docker://localhost:5000/ubi7/ubi) - Check the local registry's contents using
curl -u cloud_user https://localhost:5000/v2/_catalogand thecloud_userpassword - Use
skopeoto sync a container image fromdocker://registry.access.redhat.com/ubi7/ubi:latestto our local registry (docker://localhost:5000/ubi7/ubi) - Use
skopeoto inspect theubi7andubi8images on the local container registry - Use
skopeoto list the tags on theubi7andubi8images on the local container registry - Use
podmanto search our local registry (localhost:5000/ubi) - Use
skopeoto log out of the local container image registry atlocalhost:5000
- Check your installed version of
About the author
Real skill practice before real-world application
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.
Learn by doing
Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.
Follow your guide
All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.
Turn time into mastery
On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.