code.gitea.io/gitea@v1.22.3/docs/content/usage/packages/container.en-us.md (about)

     1  ---
     2  date: "2021-07-20T00:00:00+00:00"
     3  title: "Container Registry"
     4  slug: "container"
     5  sidebar_position: 30
     6  draft: false
     7  toc: false
     8  menu:
     9    sidebar:
    10      parent: "packages"
    11      name: "Container Registry"
    12      sidebar_position: 30
    13      identifier: "container"
    14  ---
    15  
    16  # Container Registry
    17  
    18  Publish [Open Container Initiative](https://opencontainers.org/) compliant images for your user or organization.
    19  The container registry follows the OCI specs and supports all compatible images like [Docker](https://www.docker.com/) and [Helm Charts](https://helm.sh/).
    20  
    21  ## Requirements
    22  
    23  To work with the Container registry, you can use the tools for your specific image type.
    24  The following examples use the `docker` client.
    25  
    26  ## Login to the container registry
    27  
    28  To push an image or if the image is in a private registry, you have to authenticate:
    29  
    30  ```shell
    31  docker login gitea.example.com
    32  ```
    33  
    34  If you are using 2FA or OAuth use a [personal access token](development/api-usage.md#authentication) instead of the password.
    35  
    36  ## Image naming convention
    37  
    38  Images must follow this naming convention:
    39  
    40  `{registry}/{owner}/{image}`
    41  
    42  When building your docker image, using the naming convention above, this looks like:
    43  
    44  ```shell
    45  # build an image with tag
    46  docker build -t {registry}/{owner}/{image}:{tag} .
    47  # name an existing image with tag
    48  docker tag {some-existing-image}:{tag} {registry}/{owner}/{image}:{tag}
    49  ```
    50  
    51  where your registry is the domain of your gitea instance (e.g. gitea.example.com).
    52  For example, these are all valid image names for the owner `testuser`:
    53  
    54  `gitea.example.com/testuser/myimage`
    55  
    56  `gitea.example.com/testuser/my-image`
    57  
    58  `gitea.example.com/testuser/my/image`
    59  
    60  **NOTE:** The registry only supports case-insensitive tag names. So `image:tag` and `image:Tag` get treated as the same image and tag.
    61  
    62  ## Push an image
    63  
    64  Push an image by executing the following command:
    65  
    66  ```shell
    67  docker push gitea.example.com/{owner}/{image}:{tag}
    68  ```
    69  
    70  | Parameter | Description |
    71  | ----------| ----------- |
    72  | `owner`   | The owner of the image. |
    73  | `image`   | The name of the image. |
    74  | `tag`     | The tag of the image. |
    75  
    76  For example:
    77  
    78  ```shell
    79  docker push gitea.example.com/testuser/myimage:latest
    80  ```
    81  
    82  ## Pull an image
    83  
    84  Pull an image by executing the following command:
    85  
    86  ```shell
    87  docker pull gitea.example.com/{owner}/{image}:{tag}
    88  ```
    89  
    90  | Parameter | Description |
    91  | ----------| ----------- |
    92  | `owner`   | The owner of the image. |
    93  | `image`   | The name of the image. |
    94  | `tag`     | The tag of the image. |
    95  
    96  For example:
    97  
    98  ```shell
    99  docker pull gitea.example.com/testuser/myimage:latest
   100  ```