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
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
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! Example output
Trying to pull docker.io/library/busybox... Getting image source signatures Copying blob 4c892f00285e done Copying config 22667f5368 done Writing manifest to image destination Storing signatures 22667f53682a2920948d19c7133ab1c9c3f745805c14125859d20cede07f11f9
Trying to pull docker.io/library/busybox... Getting image source signatures Copying blob 4c892f00285e done Copying config 22667f5368 done Writing manifest to image destination Storing signatures 22667f53682a2920948d19c7133ab1c9c3f745805c14125859d20cede07f11f9
Copy to Clipboard Copied! 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! 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! 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!
5.3. Creating a repository by using Skopeo
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:sudo skopeo copy --dest-tls-verify=false --all \ --src-username <source_username> --src-password <source_password> \ --src-authfile ~/.docker/config.json \ --dest-username <username> --dest-password <password> \ docker://registry.redhat.io/rhelai1/granite-8b-code-instruct:1.4-1739210683 \ docker://quay-server.example.com/<namespace>/granite-8b-code-instruct:latest
$ sudo skopeo copy --dest-tls-verify=false --all \
1 2 --src-username <source_username> --src-password <source_password> \
3 --src-authfile ~/.docker/config.json \
4 --dest-username <username> --dest-password <password> \
5 docker://registry.redhat.io/rhelai1/granite-8b-code-instruct:1.4-1739210683 \
6 docker://quay-server.example.com/<namespace>/granite-8b-code-instruct:latest
7 Copy to Clipboard Copied! - 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
Getting image source signatures Checking if image destination supports signatures Copying blob 9538fa2b8ad9 done | Copying blob 491ae95f59a2 done | Copying blob 01196d075d77 done | Copying blob e53a4633c992 done | Copying blob c266e9cfa731 done | Copying blob dae0e701d9b2 done | Copying blob 1e227a2c78d8 done | Copying blob 94ff9338861b done | Copying blob 2f2bba45146f done | Copying blob d3b4df07a0ce done | Copying blob f533a8dbb852 done | Copying config 44136fa355 done | Writing manifest to image destination Storing signatures
Getting image source signatures Checking if image destination supports signatures Copying blob 9538fa2b8ad9 done | Copying blob 491ae95f59a2 done | Copying blob 01196d075d77 done | Copying blob e53a4633c992 done | Copying blob c266e9cfa731 done | Copying blob dae0e701d9b2 done | Copying blob 1e227a2c78d8 done | Copying blob 94ff9338861b done | Copying blob 2f2bba45146f done | Copying blob d3b4df07a0ce done | Copying blob f533a8dbb852 done | Copying config 44136fa355 done | Writing manifest to image destination Storing signatures
Copy to Clipboard Copied!
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
Use the following procedure to create an image repository using the Red Hat Quay API.
Prerequisites
- You have Created an OAuth access token.
-
You have set
BROWSER_API_CALLS_XHR_ONLY: false
in yourconfig.yaml
file.
Procedure
Enter the following command to create a repository using the
POST /api/v1/repository
endpoint:curl -X POST \ -H "Authorization: Bearer <bearer_token>" \ -H "Content-Type: application/json" \ -d '{
$ curl -X POST \ -H "Authorization: Bearer <bearer_token>" \ -H "Content-Type: application/json" \ -d '{ "repository": "<new_repository_name>", "visibility": "<private>", "description": "<This is a description of the new repository>." }' \ "https://quay-server.example.com/api/v1/repository"
Copy to Clipboard Copied! Example output
{"namespace": "quayadmin", "name": "<new_repository_name>", "kind": "image"}
{"namespace": "quayadmin", "name": "<new_repository_name>", "kind": "image"}
Copy to Clipboard Copied!
5.5. Deleting a repository by using the UI
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
Use the following procedure to delete a repository using the Red Hat Quay API.
Prerequisites
- You have Created an OAuth access token.
-
You have set
BROWSER_API_CALLS_XHR_ONLY: false
in yourconfig.yaml
file.
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! 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! 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!