Jan-Lukas Else

Thoughts of an IT expert

Gitea Container Registry

Published on in 👨‍💻 Dev
Short link: https://b.jlel.se/s/5f4

I am a Gitea fan! I have been for some time now. But it’s always amazing how fast new features are implemented in the self-hosted GitHub alternative.

In the latest version 1.17 there is a new feature called “Package Registry”. This allows Gitea to be used, among other things, as an npm registry, maven registry, but also as a container registry for OCI images. For example, as an alternative to Docker Hub, the GitHub Container Registry or services such as those of Scaleway.

The container image for my URL shortener GoShort was hosted at Scaleway. In general, this was free for me, but why use a third-party service when I can just use my own Gitea instance?

The setup is simple. No special configuration is required, login with Docker is possible as follows:

docker login gitea.example.com

A generated application token can be used as a password.

The following rules must be followed when naming images:

Images must follow this naming convention:

{registry}/{owner}/{image}

For example, these are all valid image names for the owner testuser:

gitea.example.com/testuser/myimage

gitea.example.com/testuser/my-image

gitea.example.com/testuser/my/image

My Drone CI configuration for GoShort now looks like this:

kind: pipeline
name: default
type: docker
steps:
  - name: publish
    image: plugins/docker
    settings:
      username: nologin
      password:
        from_secret: docker_password
      repo: git.jlel.se/jlelse/goshort
      registry: git.jlel.se
      tags: latest
      mirror: https://mirror.gcr.io
trigger:
  branch:
    - master
  event:
    - push

Tags:

Jan-Lukas Else
Interactions & Comments