Exercise 1.4 - Working with a Container Registry

Return to Workshop

Exercise 1.4 - Working with a Container Registry

Exercise Description

In this exercise, you will learn container registry basics, what the registry offers and how to use it.

What is container registry?

A basic container registry is a stateless, highly scalable server side application that stores and distributes container images. The docker registry is an open-source project offered under the permissive Apache license.

Why use container registries?

You should use a private container registry if you want to:

  • tightly control where your images are being stored

  • fully own your image’s distribution pipeline

  • integrate image storage and distribution tightly into your in-house development workflow

Step 1. Launch a Docker registry image

First, lets run a basic registry container:

podman run -d -p 5000:5000 docker.io/registry

Step 2. View images in the local image database.

Before we upload anything, let’s take a look to see what images we have in the local image database:

podman images
REPOSITORY                                 TAG           IMAGE ID      CREATED      SIZE
registry.access.redhat.com/ubi8/python-39  latest        a7afd78bc9a6  12 days ago  900 MB
registry.access.redhat.com/ubi8            latest        7e569fa199c0  12 days ago  215 MB

Step 3. Push the container to the local registry.

To push the container, either of these two commands will work.

Choose only one of the following two commands (buildah push or skopeo copy). Both accomplish the same purpose.
buildah push --tls-verify=false --remove-signatures ubi8/python-39:latest localhost:5000/ubi8/python-39:latest

With Skopeo, we need to be a bit more specific, and specify the image ID that we saw, above, from podman images.

This image ID will vary, and you should use the value from the output produced on your workshop instance:
skopeo copy --dest-tls-verify=false --remove-signatures containers-storage:7a840db7f020 docker://localhost:5000/ubi8/python-39:latest

Step 4. Verify the image location in the registry.

Next, let’s search the registry to make sure that our image made it, and is available:

podman search --tls-verify=false localhost:5000/ubi8
NAME                           DESCRIPTION

Workshop Details

Domain Red Hat Logo
Student ID

Return to Workshop