Chapter 5. Red Hat Quay repository overview
A repository provides a central location for storing a related set of container images. These images can be used to build applications along with their dependencies in a standardized format.
Repositories are organized by namespaces. Each namespace can have multiple repositories. For example, you might have a namespace for your personal projects, one for your company, or one for a specific team within your organization.
Red Hat Quay provides users with access controls for their repositories. Users can make a repository public, meaning that anyone can pull, or download, the images from it, or users can make it private, restricting access to authorized users or teams.
There are multiple ways to create a repository in Red Hat Quay. The following options are available depending on your use case:
-
You can push an image with the relevant
podman
ordocker
command. - You can use the Red Hat Quay UI.
- You can use the Red Hat Quay API.
-
For OCI artifacts, for example, a large-language model (LLM) or machine learning application, you can use
skopeo
ororas
to copy the artifact to your repository.
5.1. Creating a repository by using the UI Copy linkLink copied to clipboard!
Use the following procedure to create a repository using the Red Hat Quay UI.
Procedure
Use the following procedure to create a repository using the v2 UI.
Procedure
- Click Repositories on the navigation pane.
- Click Create Repository.
Select a namespace, for example, quayadmin, and then enter a Repository name, for example,
testrepo
.ImportantDo not use the following words in your repository name: *
build
*trigger
*tag
*notification
When these words are used for repository names, users are unable access the repository, and are unable to permanently delete the repository. Attempting to delete these repositories returns the following error:
Failed to delete repository <repository_name>, HTTP404 - Not Found.
Click Create.
Now, your example repository should populate under the Repositories page.
-
Optional. Click Settings
Repository visibility Make private to set the repository to private.
5.2. Creating a repository by using Podman Copy linkLink copied to clipboard!
With the proper credentials, you can push an image to a repository using Podman that does not yet exist in your Red Hat Quay instance. Pushing an image refers to the process of uploading a container image from your local system or development environment to a container registry like Red Hat Quay. After pushing an image to your registry, a repository is created. If you push an image through the command-line interface (CLI) without first creating a repository on the UI, the created repository is set to Private.
Use the following procedure to create an image repository by pushing an image.
Prerequisites
-
You have download and installed the
podman
CLI. - You have logged into your registry.
- You have pulled an image, for example, busybox.
Procedure
Pull a sample page from an example registry. For example:
sudo podman pull busybox
$ sudo podman pull busybox
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Tag the image on your local system with the new repository and image name. For example:
sudo podman tag docker.io/library/busybox quay-server.example.com/quayadmin/busybox:test
$ sudo podman tag docker.io/library/busybox quay-server.example.com/quayadmin/busybox:test
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Push the image to the registry. Following this step, you can use your browser to see the tagged image in your repository.
sudo podman push --tls-verify=false quay-server.example.com/quayadmin/busybox:test
$ sudo podman push --tls-verify=false quay-server.example.com/quayadmin/busybox:test
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Getting image source signatures Copying blob 6b245f040973 done Copying config 22667f5368 done Writing manifest to image destination Storing signatures
Getting image source signatures Copying blob 6b245f040973 done Copying config 22667f5368 done Writing manifest to image destination Storing signatures
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
5.3. Creating a repository by using Skopeo Copy linkLink copied to clipboard!
In some cases, the podman
CLI tool is unable to pull certain artifact types, for example, application/x-mlmodel
, or other AI/ML artifacts. Attempting to use podman pull
with this artifact type results in the following error:
Error: parsing image configuration: unsupported image-specific operation on artifact with type "application/x-mlmodel"
Error: parsing image configuration: unsupported image-specific operation on artifact with type "application/x-mlmodel"
As an alternative, you can use skopeo copy
to copy an artifact from one location to your Red Hat Quay repository.
Prerequisites
-
You have installed the
skopeo
CLI. -
You have logged in to a source registry (in this example,
\registry.redhat.io
) and have a valid authentication file (~/.docker/config.json
). Alternatively, you can provide credentials by using the--src-username
and--src-password
parameters when running a command with theskopeo
CLI. - You have logged in to your Red Hat Quay repository.
- Depending on the size of your AI/ML artifact, you might have to Prepare your registry to accept large artifacts.
Procedure
Use the
skopeo copy
command on an artifact to copy the artifact to your Red Hat Quay repository. For example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Optional.
--dest-tls-verify=false
disables SSL/TLS verification for the destination registry. - 2
- Optional. The
--all
flag optionally copies all image manifests, including multi-architecture images. - 3
- Optional. If you are not logged into a registry, you can pass in the source registry credentials with these parameters.
- 4
- Optional. The path to your Docker authentication file. Typically located at
~/.docker/config.json
. - 5
- Your Red Hat Quay registry username and password.
- 6
- The source image or artifact from the Red Hat container registry. Ensure that you are logged in to the registry and that you can pull the image.
- 7
- The URL of your Red Hat Quay repository appended with a namespace and the name of the image.
Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Next steps
- After you have pushed a machine learning artifact to your Red Hat Quay repository, you can View tag information by using the UI or View model card information by using the UI.
5.4. Creating a repository by using the API Copy linkLink copied to clipboard!
Use the following procedure to create an image repository using the Red Hat Quay API.
Prerequisites
- You have Created an OAuth access token.
Procedure
Enter the following command to create a repository using the
POST /api/v1/repository
endpoint:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
{"namespace": "quayadmin", "name": "<new_repository_name>", "kind": "image"}
{"namespace": "quayadmin", "name": "<new_repository_name>", "kind": "image"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
5.5. Deleting a repository by using the UI Copy linkLink copied to clipboard!
You can delete a repository directly on the UI.
Prerequisites
- You have created a repository.
Procedure
-
On the Repositories page of the v2 UI, check the box of the repository that you want to delete, for example,
quayadmin/busybox
. - Click the Actions drop-down menu.
- Click Delete.
Type confirm in the box, and then click Delete.
After deletion, you are returned to the Repositories page.
5.6. Deleting a repository by using the Red Hat Quay API Copy linkLink copied to clipboard!
Use the following procedure to delete a repository using the Red Hat Quay API.
Prerequisites
- You have Created an OAuth access token.
Procedure
Enter the following command to delete a repository using the
DELETE /api/v1/repository/{repository}
endpoint:curl -X DELETE -H "Authorization: Bearer <bearer_token>" "<quay-server.example.com>/api/v1/repository/<namespace>/<repository_name>"
$ curl -X DELETE -H "Authorization: Bearer <bearer_token>" "<quay-server.example.com>/api/v1/repository/<namespace>/<repository_name>"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The CLI does not return information when deleting a repository from the CLI. To confirm deletion, you can check the Red Hat Quay UI, or you can enter the following
GET /api/v1/repository/{repository}
command to see if details are returned for the deleted repository:curl -X GET -H "Authorization: Bearer <bearer_token>" "<quay-server.example.com>/api/v1/repository/<namespace>/<repository_name>"
$ curl -X GET -H "Authorization: Bearer <bearer_token>" "<quay-server.example.com>/api/v1/repository/<namespace>/<repository_name>"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
{"detail": "Not Found", "error_message": "Not Found", "error_type": "not_found", "title": "not_found", "type": "http://quay-server.example.com/api/v1/error/not_found", "status": 404}
{"detail": "Not Found", "error_message": "Not Found", "error_type": "not_found", "title": "not_found", "type": "http://quay-server.example.com/api/v1/error/not_found", "status": 404}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow