- Change the visibility of the Container Registry
- List registry repositories
- Get details of a single repository
- Delete registry repository
- List registry repository tags
- Get details of a registry repository tag
- Delete a registry repository tag
- Delete registry repository tags in bulk
- Instance-wide endpoints
Container Registry API
The use of This is the API documentation of the GitLab Container Registry.
When the GitLab administrators with access to the GitLab Rails console
can opt to enable it.
To enable it:
To disable it:
This controls who can view the Container Registry.
Descriptions of the possible values for enabled (Default): The Container Registry is visible to everyone with access to the project.
If the project is public, the Container Registry is also public. If the project is internal or
private, the Container Registry is also internal or private.
private: The Container Registry is visible only to project members with Reporter role or
higher. This is similar to the behavior of a private project with Container Registry visibility set
to enabled.
disabled: The Container Registry is disabled.
See the Container Registry visibility permissions
for more details about the permissions that this setting grants to users.
Example response:
Get a list of registry repositories in a project.
CI_JOB_TOKEN
scoped to the current project was
ci_job_token_scope
feature flag is enabled (it is disabled by default), you can use the below endpoints
from a CI/CD job, by passing the $CI_JOB_TOKEN
variable as the JOB-TOKEN
header.
The job token will only have access to its own project.
Feature.enable(:ci_job_token_scope)
Feature.disable(:ci_job_token_scope)
Change the visibility of the Container Registry
PUT /projects/:id/
Attribute
Type
Required
Description
id
integer/string
yes
The ID or URL-encoded path of the project accessible by the authenticated user.
container_registry_access_level
string
no
The desired visibility of the Container Registry. One of enabled
(default), private
, or disabled
.
container_registry_access_level
:
curl --request PUT "https://gitlab.example.com/api/v4/projects/5/" \
--header 'PRIVATE-TOKEN: <your_access_token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
"container_registry_access_level": "private"
}'
{
"id": 5,
"name": "Project 5",
"container_registry_access_level": "private",
...
}
List registry repositories
Within a project
GET /projects/:id/registry/repositories