Container registry metadata database for new installations
- Tier: Free, Premium, Ultimate
- Offering: GitLab Self-Managed
Enable the container registry metadata database for your instance.
Enable the metadata database
Enable the metadata database for a new container registry.
Prerequisites:
- You must have a new container registry with no images pushed to the registry. To enable the database:
Enable the database by editing
/etc/gitlab/gitlab.rband settingenabledtotrue:registry['database'] = { 'enabled' => true, }Save the file and reconfigure GitLab.
Prerequisites:
- You must have a new container registry with no images pushed to the registry.
- Create an external database.
To enable the database:
Edit
/etc/gitlab/gitlab.rbby adding your database connection details, but start with the metadata database disabled:registry['database'] = { 'enabled' => false, 'host' => '<registry_database_host_placeholder_change_me>', 'port' => 5432, # Default, but set to the port of your database instance if it differs. 'user' => '<registry_database_username_placeholder_change_me>', 'password' => '<registry_database_placeholder_change_me>', 'dbname' => '<registry_database_name_placeholder_change_me>', 'sslmode' => 'require', # See the PostgreSQL documentation for additional information https://www.postgresql.org/docs/16/libpq-ssl.html. 'sslcert' => '</path/to/cert.pem>', 'sslkey' => '</path/to/private.key>', 'sslrootcert' => '</path/to/ca.pem>' }Save the file and reconfigure GitLab.
Enable the database by editing
/etc/gitlab/gitlab.rband settingenabledtotrue:registry['database'] = { 'enabled' => true, 'host' => '<registry_database_host_placeholder_change_me>', 'port' => 5432, # Default, but set to the port of your database instance if it differs. 'user' => '<registry_database_username_placeholder_change_me>', 'password' => '<registry_database_placeholder_change_me>', 'dbname' => '<registry_database_name_placeholder_change_me>', 'sslmode' => 'require', # See the PostgreSQL documentation for additional information https://www.postgresql.org/docs/16/libpq-ssl.html. 'sslcert' => '</path/to/cert.pem>', 'sslkey' => '</path/to/private.key>', 'sslrootcert' => '</path/to/ca.pem>' }
You can now use the metadata database for all operations!