Commit 35454577 authored by Suzanne Selhorn's avatar Suzanne Selhorn Committed by Mike Jang

Docs: Edited Container Registry docs

Related to: https://gitlab.com/gitlab-org/gitlab/-/issues/247950
parent f9c03a28
......@@ -441,9 +441,9 @@ On your GitLab project repository navigate to the **Registry** tab.
![container registry page empty image](img/container_registry_page_empty_image.png)
You may need to [enable Container Registry](../../../user/packages/container_registry/index.md#enable-the-container-registry-for-your-project) to your project to see this tab. You'll find it under your project's **Settings > General > Visibility, project features, permissions**.
You may need to enable the Container Registry for your project to see this tab. You'll find it under your project's **Settings > General > Visibility, project features, permissions**.
To start using Container Registry on our machine, we first need to login to the GitLab registry using our GitLab username and password:
To start using Container Registry on our machine, we first need to sign in to the GitLab registry using our GitLab username and password:
```shell
docker login registry.gitlab.com
......
......@@ -16,100 +16,44 @@ info: To determine the technical writer assigned to the Stage/Group associated w
> - The group level Container Registry was [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/23315) in GitLab 12.10.
> - Searching by image repository name was [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/31322) in GitLab 13.0.
NOTE: **Note:**
This document is the user guide. To learn how to enable GitLab Container
Registry across your GitLab instance, visit the
[administrator documentation](../../../administration/packages/container_registry.md).
With the Docker Container Registry integrated into GitLab, every project can
With the Docker Container Registry integrated into GitLab, every GitLab project can
have its own space to store its Docker images.
You can read more about Docker Registry at <https://docs.docker.com/registry/introduction/>.
![Container Registry repositories](img/container_registry_repositories_v13_1.png)
## Enable the Container Registry for your project
CAUTION: **Warning:**
The Container Registry follows the visibility settings of the project. If the project is public, so is the Container Registry.
If you cannot find the **Packages & Registries > Container Registry** entry under your
project's sidebar, it is not enabled in your GitLab instance. Ask your
administrator to enable GitLab Container Registry following the
[administration documentation](../../../administration/packages/container_registry.md).
If you are using GitLab.com, this is enabled by default so you can start using
the Registry immediately. Currently there is a soft (10GB) size restriction for
Registry on GitLab.com, as part of the [repository size limit](../../project/repository/index.md).
Once enabled for your GitLab instance, to enable Container Registry for your
project:
1. Go to your project's **Settings > General** page.
1. Expand the **Visibility, project features, permissions** section
and enable the **Container Registry** feature on your project. For new
projects this might be enabled by default. For existing projects
(prior GitLab 8.8), enable it explicitly.
1. Press **Save changes** for the changes to take effect. You should now be able
to see the **Packages & Registries > Container Registry** link in the sidebar.
## Control Container Registry from within GitLab
GitLab offers a simple Container Registry management panel. This management panel is available
for both projects and groups.
### Control Container Registry for your project
Navigate to your project's **{package}** **Packages & Registries > Container Registry**.
![Container Registry project repositories](img/container_registry_repositories_with_quickstart_v13_1.png)
This view allows you to:
- Show all the image repositories that belong to the project.
- Filter image repositories by their name.
- [Delete](#delete-images-from-within-gitlab) one or more image repository.
- Navigate to the image repository details page.
- Show a **Quick start** dropdown with the most common commands to log in, build and push.
- Show a banner if the optional [cleanup policy](#cleanup-policy) is enabled for this project.
### Control Container Registry for your group
Navigate to your group's **{package}** **Packages & Registries > Container Registry**.
![Container Registry group repositories](img/container_registry_group_repositories_v13_1.png)
NOTE: **Note:**
This document is the user guide. To learn how to enable the Container
Registry for your GitLab instance, visit the
[administrator documentation](../../../administration/packages/container_registry.md).
This view allows you to:
## View the Container Registry
- Show all the image repositories of the projects that belong to this group.
- [Delete](#delete-images-from-within-gitlab) one or more image repositories.
- Navigate to a specific image repository details page.
You can view the Container Registry for a project or group.
### Image Repository details page
1. Go to your project or group.
1. Go to **Packages & Registries > Container Registry**.
Clicking on the name of any image repository navigates to the details.
You can search, sort, filter, and [delete](#delete-images-from-within-gitlab) containers on this page.
![Container Registry project repository details](img/container_registry_repository_details_v13.0.png)
CAUTION: **Warning:**
If a project is public, so is the Container Registry.
NOTE: **Note:**
The following page has the same functionalities both in the **Group level container registry**
and in the **Project level container registry**.
## Use images from the Container Registry
This view:
To download and run a container image hosted in the GitLab Container Registry:
- Shows all the image repository details.
- Shows all the tags of the image repository.
- Allows you to quickly copy the tag path (by clicking on the clipboard button near the tag name).
- Allows you to [delete one or more tags](#delete-images-from-within-gitlab).
1. Copy the link to your container image:
- Go to your project or group's **Packages & Registries > Container Registry**
and find the image you want.
- Next to the image name, click the **Copy** button.
## Use images from GitLab Container Registry
![Container Registry image URL](img/container_registry_hover_path_13_4.png)
To download and run a container from images hosted in GitLab Container Registry,
use `docker run`:
1. Use `docker run` with the image link:
```shell
docker run [options] registry.example.com/group/project/image [arguments]
```
```shell
docker run [options] registry.example.com/group/project/image [arguments]
```
For more information on running Docker containers, visit the
[Docker documentation](https://docs.docker.com/engine/userguide/intro/).
......@@ -118,10 +62,10 @@ For more information on running Docker containers, visit the
If you visit the **Packages & Registries > Container Registry** link under your project's
menu, you can see the explicit instructions to login to the Container Registry
using your GitLab credentials.
by using your GitLab credentials.
For example if the Registry's URL is `registry.example.com`, then you should be
able to login with:
able to log in with:
```shell
docker login registry.example.com
......@@ -175,6 +119,10 @@ registry.example.com/group/project/image:latest
registry.example.com/group/project/my/image:rc1
```
NOTE: **Note:**
Currently there is a soft (10GB) size restriction for
the Container Registry on GitLab.com, as part of the [repository size limit](../../project/repository/index.md).
## Build and push images using GitLab CI/CD
While you can build and push your images from your local machine, take
......@@ -406,8 +354,6 @@ To delete images from within GitLab:
1. In the dialog box, click **Remove tag**.
![Container Registry tags](img/container_registry_repository_details_v13.0.png)
### Delete images using the API
If you want to automate the process of deleting images, GitLab provides an API. For more
......@@ -652,6 +598,19 @@ Container Registry, you must delete all existing images.
- Prior to GitLab 12.10, any tags that use the same image ID as the `latest` tag
are not deleted by the cleanup policy.
## Disable the Container Registry for a project
The Container Registry is enabled by default.
You can, however, remove the Container Registry for a project:
1. Go to your project's **Settings > General** page.
1. Expand the **Visibility, project features, permissions** section
and disable **Container Registry**.
1. Click **Save changes**.
The **Packages & Registries > Container Registry** entry is removed from the project's sidebar.
## Troubleshooting the GitLab Container Registry
### Docker connection error
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment