Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to configure the Container metadata registry database on this image? #3044

Open
HoshinoRei opened this issue Dec 16, 2024 · 1 comment

Comments

@HoshinoRei
Copy link

The configuration method in Official Tutorial does not apply to this image, how to configure the Container metadata registry database painlessly after using this image?

@kkimurak
Copy link
Contributor

Set following configuration parameters in your configuration file (environment section in docker-compose.yml, env section in gitlab-rc.yml for example):

official tutorial: entry in /etc/gitlab/gitlab.rb configuration parameter for sameersbn/gitlab
registry['database'].enabled GITLAB_REGISTRY_ENABLED
registry['database'].host GITLAB_REGISTRY_HOST
registry['database'].port GITLAB_REGISTRY_PORT
registry['database'].api_url GITLAB_REGISTRY_API_URL
registry['database'].key GITLAB_REGISTRY_KEY_PATH
registry['database'].path GITLAB_REGISTRY_DIR
registry['database'].issuer GITLAB_REGISTRY_ISSUER

In the source-installed environment provided by this image (sameersbn/gitlab), settings must be written in /home/git/gitlab/config/gitlab.yml instead of /etc/gitlab/gitlab.rb that is used in omnibus-installation.
sameersbn/gitlab provides a file that replaces the values ​​in this configuration file with placeholders. When the container is started, these placeholders are rewritten according to the values ​​of the environment variables.

optionally, internal certificates can be generated on startup if you set GITLAB_REGISTRY_GENERATE_INTERNAL_CERTIFICATES to true.

This is documented in README.md (use links on each configuration parameter)

Note that our configuration parameters are not up to date - some parameters may be slate, some upstream configurations may not have a corresponding parameter.
For example, we have not been able to support user-password authentication yet (entry registry['database'].user and .password cannot be set).

Please submit a pull request to update configuration files or wait for the update. To submit a PR, please refer to the merged pull request (#2953 for example).

Alternatively, you may be able to set these parameters by

  1. launch container (docker run, docker compose up and so on)
  2. log into container as user git (docker exec -it -u git your-gitlab-container-name /bin/bash)
  3. edit gitlab.yml directly (note that most of major text editors are not available in container)
  4. log out from container
  5. log into container as user root (docker exec -it your-gitlab-container-name /bin/bash)
  6. reload gitlab services by executing supervisorctl reload

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants