What are Image Registries
A registry is a repository used to store and access container images. Container registries can support container-based application development, often as part of DevOps processes.
Container registries save developers valuable time in the creation and delivery of cloud-native applications, acting as the intermediary for sharing container images between systems. They essentially act as a place for developers to store container images and share them out via a process of uploading (pushing) to the registry and downloading (pulling) into another system, like a Kubernetes cluster.
Some examples of an image registry are Red Hat Quay and IBM Cloud Registry.
Quay Tutorial
Make sure you have Podman Desktop installed and up and running.
Here's how to find a list of publicly available container images on DockerHub.
NAME DESCRIPTION
docker.io/library/busybox Busybox base image.
docker.io/rancher/busybox
docker.io/openebs/busybox-client
docker.io/antrea/busybox
docker.io/hugegraph/busybox test image
...
We can create a busybox container image based off of the busybox base image you see listed in the output above.
The -it flag allows you to run the image in interactive mode. Interactive mode in Podman allows you to run a shell in a container and interact with it. However, you'll see that running small containers like this one don't have much to play around with in the interactive mode. To exit out of the interactive mode:
You can also share images in a public registry so that others can use and review them. Here's how to push your image up to quay.io.
Enter in the following info:Next, tag the image so that you can push it and find it in your account.
Make sure to replace "image_name" with the name of the image you want to push up to quay. Replace "user_name" with your quay.io username. Replace "image_registry_name" with what you want the image to be named/labeled as in quay.
Once the image is tagged, you can push it up to quay.
Your respository has now been pushed to Quay Container Registry!
To view your repository, click on the button below:
Make sure you have Docker Desktop installed and up and running.
First we'll create a container with a single new file based off of the busybox base image:
The container will immediately terminate, so we'll use the command below to list it: The next step is to commit the container to an image and then tag that image with a relevant name so it can be saved to a respository.Replace "container_id" with your container id from the previous command.
Be sure to replace "your_username" with your quay.io username and "respository_name" with a unique name for your repository.Now that we've tagged our image with a repository name, we can push the respository to Quay Container Registry:
Your respository has now been pushed to Quay Container Registry!To view your repository, click on the button below:
IBM Cloud Registry Tutorial
1. Install the Container Registry CLI
Before you begin, you need to install the IBM Cloud CLI so that you can run the IBM Cloud ibmcloud commands.
2. Set up a namespaceThen, you need to create a namespace. The namespace is created in the resource group that you specify so that you can configure access to resources within the namespace at the resource group level. If you don't specify a resource group, then the default is used.
Make sure to replace <my_namespace> with your preferred namespace.If you want to create the namespace in a specific resource group, use the following code before creating the namespace.
Replace <resource_group> with the resource group you want to create the namespace in.To validate the namespace was created, run the following command.
3. Pull images from a registry to your local computer
Next, you can pull images from IBM Cloud Registry to your local computer. Make sure Podman is installed and up and running.
Replace <source_image> with the respository of the image and <tag> with the tag of the image that you want to use.Below is an example where <source_image> is "hello-world" and <tag> is "latest".
4. Tag the image
Tags are used as an optional identifier to specify a particular version of an image.
Replace <source_image> with the respository of the image, <tag> with the tag of your local image that you previously pulled, <region> with the name of your region, and <my_namespace> with the namespace you created in step 2. You'll want to define the repository and tag of the image that you want to use in your namespace by replacing <new_image_repo> and <new_tag> respectively.Below is an example where <source_image> is "hello-world", <tag> is "latest", <region> is "uk", <my_namespace> is "namespace1", <new_image_repo> is "hw_repo", and <new_tag> is "1".
5. Push images to your namespace
First, you'll need to log in to IBM Cloud Container Registry.
Once you've logged in, you can push the image up to your namespace in the registry.
Replace <my_namespace> with the namespace you created in step 2 and <image_repo> and <tag> with the repository and tag of the image you chose when you tagged the image in step 4.
Below is an example where <region> is "uk", <my_namespace> is "namespace1", <image_repo> is "hw_repo", and <tag> is "1".
6. Verify that the image was pushed
Verify that the image was pushed successfully by running the comand below.
You can also view your pushed images by clicking on the button below:
1. Install the Container Registry CLI
Before you begin, you need to install the IBM Cloud CLI so that you can run the IBM Cloud ibmcloud commands.
2. Set up a namespace
Then, you need to create a namespace. The namespace is created in the resource group that you specify so that you can configure access to resources within the namespace at the resource group level. If you don't specify a resource group, then the default is used.
Make sure to replace <my_namespace> with your preferred namespace.If you want to create the namespace in a specific resource group, use the following code before creating the namespace.
Replace <resource_group> with the resource group you want to create the namespace in.To validate the namespace was created, run the following command.
3. Pull images from a registry to your local computer
Next, you can pull images from IBM Cloud Registry to your local computer. Make sure Docker is installed and up and running.
Replace <source_image> with the respository of the image and <tag> with the tag of the image that you want to use.Below is an example where <source_image> is "hello-world" and <tag> is "latest".
4. Tag the image
Tags are used as an optional identifier to specify a particular version of an image.
Replace <source_image> with the respository of the image, <tag> with the tag of your local image that you previously pulled, <region> with the name of your region, and <my_namespace> with the namespace you created in step 2. You'll want to define the repository and tag of the image that you want to use in your namespace by replacing <new_image_repo> and <new_tag> respectively.Below is an example where <source_image> is "hello-world", <tag> is "latest", <region> is "uk", <my_namespace> is "namespace1", <new_image_repo> is "hw_repo", and <new_tag> is "1".
5. Push images to your namespace
First, you'll need to log in to IBM Cloud Container Registry.
Once you've logged in, you can push the image up to your namespace in the registry.
Replace <my_namespace> with the namespace you created in step 2 and <image_repo> and <tag> with the repository and tag of the image you chose when you tagged the image in step 4.
Below is an example where <region> is "uk", <my_namespace> is "namespace1", <image_repo> is "hw_repo", and <tag> is "1".
6. Verify that the image was pushed
Verify that the image was pushed successfully by running the comand below.
You can also view your pushed images by clicking on the button below: