Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. GitLab
  3. Gitlab how to run container registry

Gitlab how to run container registry

Scheduled Pinned Locked Moved Unsolved GitLab
gitlab
31 Posts 11 Posters 5.3k Views 17 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • girishG girish

    I went down the container registry rabbit hole. In the end, it seems that it provides gitlab's authentication layer for the docker registry i.e users/groups/projects have same permissions in the registry as of gitlab. It has a limitation that the registry and the gitlab have to be on the same server. There is some strange path sharing requirement that I don't completely understand - https://docs.gitlab.com/ce/administration/packages/container_registry.html#use-file-system

    I think an alternate approach is get Harbor working. It looks simple enough to deploy since it's a Go app and also has LDAP. This will then work with GitLab CI/CD (nice article). This won't bring in gitlab's auth into the registry though. Are people looking for something like that? (it seems something for big enterprises).

    marioM Offline
    marioM Offline
    mario
    App Dev
    wrote on last edited by
    #22

    @girish I definitely have a use case for this despite not being a super-huge enterprise, which is why I'm trying to get it done. And I will - it's just a matter of time 🙂

    I'm not against Harbor, etc. but I do need this to work which is why I'm on it 🙂

    girishG 1 Reply Last reply
    1
    • marioM mario

      @girish I definitely have a use case for this despite not being a super-huge enterprise, which is why I'm trying to get it done. And I will - it's just a matter of time 🙂

      I'm not against Harbor, etc. but I do need this to work which is why I'm on it 🙂

      girishG Offline
      girishG Offline
      girish
      Staff
      wrote on last edited by
      #23

      @mario You left me a note somewhere on how to use the docker registry app with GitLab but I cannot find it anymore. Where did you put it?

      marioM 1 Reply Last reply
      0
      • girishG girish

        @mario You left me a note somewhere on how to use the docker registry app with GitLab but I cannot find it anymore. Where did you put it?

        marioM Offline
        marioM Offline
        mario
        App Dev
        wrote on last edited by
        #24

        @girish README inside the repo: https://git.cloudron.io/cloudron/docker-registry-app

        girishG 1 Reply Last reply
        0
        • marioM mario

          @girish README inside the repo: https://git.cloudron.io/cloudron/docker-registry-app

          girishG Offline
          girishG Offline
          girish
          Staff
          wrote on last edited by
          #25

          @mario 🤦 Sorry I missed the most obvious place, I was looking all over.

          arshsahzadA 1 Reply Last reply
          0
          • N niels referenced this topic on
          • girishG girish

            @mario 🤦 Sorry I missed the most obvious place, I was looking all over.

            arshsahzadA Offline
            arshsahzadA Offline
            arshsahzad
            wrote on last edited by
            #26

            Need Help: Has anyone enabled container registry in the cloudron gitlab, I'm getting error 500 when making changes to the gitlab.yml file.

              registry:
                enabled: true
                host: registry.git.arsh.dev
                port: 5005
                api_url: http://localhost:5000/ # internal address to the registry, will be used by GitLab to directly communicate with API
                key: config/registry.key
                path: shared/registry
                issuer: gitlab-issuer
            
            girishG 2 Replies Last reply
            0
            • arshsahzadA arshsahzad

              Need Help: Has anyone enabled container registry in the cloudron gitlab, I'm getting error 500 when making changes to the gitlab.yml file.

                registry:
                  enabled: true
                  host: registry.git.arsh.dev
                  port: 5005
                  api_url: http://localhost:5000/ # internal address to the registry, will be used by GitLab to directly communicate with API
                  key: config/registry.key
                  path: shared/registry
                  issuer: gitlab-issuer
              
              girishG Offline
              girishG Offline
              girish
              Staff
              wrote on last edited by
              #27

              @arshsahzad said in Gitlab how to run container registry:

              I'm getting error 500 when making changes to the gitlab.yml file

              This most likely means there is an error in the yml syntax. What error do you see in the logs ? You will find more logs in /run/gitlab (via web terminal).

              1 Reply Last reply
              0
              • arshsahzadA arshsahzad

                Need Help: Has anyone enabled container registry in the cloudron gitlab, I'm getting error 500 when making changes to the gitlab.yml file.

                  registry:
                    enabled: true
                    host: registry.git.arsh.dev
                    port: 5005
                    api_url: http://localhost:5000/ # internal address to the registry, will be used by GitLab to directly communicate with API
                    key: config/registry.key
                    path: shared/registry
                    issuer: gitlab-issuer
                
                girishG Offline
                girishG Offline
                girish
                Staff
                wrote on last edited by
                #28

                @arshsahzad Have you seen https://docs.cloudron.io/apps/docker-registry/#gitlab-integration already ?

                arshsahzadA 2 Replies Last reply
                0
                • girishG girish

                  @arshsahzad Have you seen https://docs.cloudron.io/apps/docker-registry/#gitlab-integration already ?

                  arshsahzadA Offline
                  arshsahzadA Offline
                  arshsahzad
                  wrote on last edited by arshsahzad
                  #29

                  Hi @girish, I have not yet looked into the document, I will let you know...

                  1 Reply Last reply
                  1
                  • girishG girish

                    @arshsahzad Have you seen https://docs.cloudron.io/apps/docker-registry/#gitlab-integration already ?

                    arshsahzadA Offline
                    arshsahzadA Offline
                    arshsahzad
                    wrote on last edited by arshsahzad
                    #30

                    Hi @girish, From the Docs:

                    1. Create a volume named registry-shared.
                    
                    2. Attach volume name registry-shared to both GitLab and Docker Registry apps. Be sure to uncheck the Read Only checkbox.
                    
                    3. Create folders containers and certs on the host filesystem inside the path that is assigned to the registry-shared volume.
                    
                    4. Run the following commands inside the certs folder:
                    
                    openssl req -nodes -newkey rsa:2048 -keyout registry-auth.key -out registry-auth.csr -subj "/CN=gitlab-issuer"
                    openssl x509 -in registry-auth.csr -out registry-auth.crt -req -signkey registry-auth.key -days 365000
                    chmod 777 registry-auth.key registry-auth.crt registry-auth.csr
                    
                    5. Modify the permissions from root to cloudron inside the Docker Registry app for the created folders and files.
                    
                    chown -R cloudron:cloudron /media/registry-shared/
                    
                    6. Modify /app/data/config.yml of the Docker Registry app using the File manager by altering or adding the auth part to resemble the following:
                    
                    auth:
                      token:
                        realm: https://<GITLAB_HOST>/jwt/auth
                        service: container_registry
                        issuer: gitlab-issuer
                        rootcertbundle: /media/registry-shared/certs/registry-auth.crt
                    Change the 'rootdirectory' value inside the same config file to:
                    
                    
                    /media/registry-shared/containers
                    Save the file and restart the app.
                    
                    7. Modify /app/data/gitlab.yml of the GitLab app by adding the following lines (some of them might already be there, so skip them):
                    
                    production:
                      <<: *base
                    
                      registry:
                        enabled: true
                        host: <DOCKER_REGISTRY_HOST>
                        port: 443
                        api_url: https://<DOCKER_REGISTRY_HOST>
                        key: /media/registry-shared/certs/registry-auth.key
                        path: /media/registry-shared/containers
                        issuer: gitlab-issuer
                    
                    1. I have created the directory in the host machine
                    /opt/registry-shared
                    
                    1. Created two other folders (containers & certs) in the registry-shared directory

                    2. Generated keys in certs folders using the following cmd

                    arshsahzadA 1 Reply Last reply
                    0
                    • arshsahzadA arshsahzad

                      Hi @girish, From the Docs:

                      1. Create a volume named registry-shared.
                      
                      2. Attach volume name registry-shared to both GitLab and Docker Registry apps. Be sure to uncheck the Read Only checkbox.
                      
                      3. Create folders containers and certs on the host filesystem inside the path that is assigned to the registry-shared volume.
                      
                      4. Run the following commands inside the certs folder:
                      
                      openssl req -nodes -newkey rsa:2048 -keyout registry-auth.key -out registry-auth.csr -subj "/CN=gitlab-issuer"
                      openssl x509 -in registry-auth.csr -out registry-auth.crt -req -signkey registry-auth.key -days 365000
                      chmod 777 registry-auth.key registry-auth.crt registry-auth.csr
                      
                      5. Modify the permissions from root to cloudron inside the Docker Registry app for the created folders and files.
                      
                      chown -R cloudron:cloudron /media/registry-shared/
                      
                      6. Modify /app/data/config.yml of the Docker Registry app using the File manager by altering or adding the auth part to resemble the following:
                      
                      auth:
                        token:
                          realm: https://<GITLAB_HOST>/jwt/auth
                          service: container_registry
                          issuer: gitlab-issuer
                          rootcertbundle: /media/registry-shared/certs/registry-auth.crt
                      Change the 'rootdirectory' value inside the same config file to:
                      
                      
                      /media/registry-shared/containers
                      Save the file and restart the app.
                      
                      7. Modify /app/data/gitlab.yml of the GitLab app by adding the following lines (some of them might already be there, so skip them):
                      
                      production:
                        <<: *base
                      
                        registry:
                          enabled: true
                          host: <DOCKER_REGISTRY_HOST>
                          port: 443
                          api_url: https://<DOCKER_REGISTRY_HOST>
                          key: /media/registry-shared/certs/registry-auth.key
                          path: /media/registry-shared/containers
                          issuer: gitlab-issuer
                      
                      1. I have created the directory in the host machine
                      /opt/registry-shared
                      
                      1. Created two other folders (containers & certs) in the registry-shared directory

                      2. Generated keys in certs folders using the following cmd

                      arshsahzadA Offline
                      arshsahzadA Offline
                      arshsahzad
                      wrote on last edited by
                      #31

                      @arshsahzad said in Gitlab how to run container registry:

                      1. Attach volume name registry-shared to both GitLab and Docker Registry apps. Be sure to uncheck the Read Only checkbox.

                      I'm not able to figure out, how to attach the bind mount to the running gitlab container and how to uncheck read only checkbox

                      /opt/registry-shared
                      
                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Bookmarks
                      • Search