I have installed gitlab-ce 13.2.0 on my server and the container-registry was immediately available.
from a other sever (or my local machine) I can login, but when pushing a image to the container-registry I get a 404-error: error parsing HTTP 404 response body: invalid character '<' looking for beginning of value: "<!DOCTYPE html>\n<html>\n<head>...
in my gitlab.rb I have:
external_url 'https://git.xxxxxxxx.com'
nginx['enable'] = true
nginx['client_max_body_size'] = '250m'
nginx['redirect_http_to_https'] = true
nginx['ssl_certificate'] = "/etc/gitlab/trusted-certs/xxxxxxxx.com.crt"
nginx['ssl_certificate_key'] = "/etc/gitlab/trusted-certs/xxxxxxxx.com.key"
nginx['ssl_protocols'] = "TLSv1.1 TLSv1.2"
registry_external_url 'https://git.xxxxxxxx.com'
what is confusing, is that the registry_external_url
is the same as the external_url
. There are those lines in the gitlab.rb:
### Settings used by GitLab application
# gitlab_rails['registry_enabled'] = true
# gitlab_rails['registry_host'] = "git.xxxxxxxx.com"
# gitlab_rails['registry_port'] = "5005"
# gitlab_rails['registry_path'] = "/var/opt/gitlab/gitlab-rails/shared/registry"
But when I uncomment this, I cannot login.
what can be the problem here?
GitLab Container Registry is a secure and private registry for Docker images. Built on open source software, GitLab Container Registry isn't just a standalone registry; it's completely integrated with GitLab.
Once enabled for your GitLab instance, to enable Container Registry for your project: Go to your project's Settings > General page. 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.
Gitlab has a Docker container registry included in their services. Integrating Gitlab container registry is really simple if you are aleady using Gitlab to host your code.
Gitlab has a Docker container registry included in their services. Integrating Gitlab container registry is really simple if you are aleady using Gitlab to host your code. This guide explains how you can integrate Gitlab container registry into your project. To build Docker images we use the latest docker image image: docker:latest .
Use GitLab CI/CD to build and push images to the Container Registry. Use it to test, build, and deploy your project from the Docker image you created. Before you can build and push images by using GitLab CI/CD, you must authenticate with the Container Registry.
If you are on GitLab self-managed instances and you have 1000+ tags in a container repository, you might run into a Container Registry token expiration issue , with error authorizing context: invalid token in the logs. If you are on GitLab 13.9 or later, you can set limits for the cleanup policy .
This is actually because you are using https port without proxying the registry in nginx.
Fix these lines according to the following in gitlab.rb:
registry_nginx['enable'] = true
registry_nginx['listen_https'] = true
registry_nginx['redirect_http_to_https'] = true
registry_external_url 'https://registry.YOUR_DOMAIN.gtld'
You don't need to touch nginx['ssl_*]
parameters when you are using letsencrypt since the chef would take care.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With