<!-- END doctoc generated TOC please keep comment here to allow auto update -->
## How to enable the Container Registry
## Differences between Omnibus and source installations
**Omnibus GitLab installations**
If you are using Omnibus, you have to bare in mind the following:
...
...
@@ -35,19 +39,21 @@ If you are using Omnibus, you have to bare in mind the following:
on how to achieve that. You will also have to configure your firewall to allow
connections to that port.
- The container Registry works under HTTPS by default. Using HTTP is possible
but not recommended and out of the scope of this document,
[see the insecure Registry documentation][docker-insecure] if you want to
but not recommended and out of the scope of this document.
[See the insecure Registry documentation][docker-insecure] if you want to
implement this.
---
**Installations from source**
If you have installed GitLab from source:
- Omnibus has some things configured for you
- You will have to install Docker Registry by yourself. You can follow the
[official documentation][registry-deploy].
- The container Registry will not be enabled by default, you will have to
configure it in `gitlab.yml`.
1. You will have to [install Docker Registry][registry-deploy] by yourself.
1. After the installation is complete, you will have to configure the Registry's
settings `gitlab.yml` in order to enable it.
1. Use the sample NGINX configuration file that is found under
[`lib/support/nginx/registry-ssl`][registry-ssl].
The contents of `gitlab.yml` are:
...
...
@@ -66,26 +72,31 @@ where:
| Parameter | Description |
| --------- | ----------- |
| `enabled` | Enables the Registry in GitLab. By default this is false. |
| `enabled` | `true` or `false`. Enables the Registry in GitLab. By default this is `false`. |
| `host` | The host URL under which the Registry will run and the users will be able to use. |
| `port` | The port under which the external Registry domain will listen on. |
| `api_url` | The internal API URL under which the Registry is exposed to. It defaults to `http://localhost:5000`. |
| `key_path`| The private key location that is a pair of Registry's `rootcertbundle`. Read the [token auth configuration documentation][token-config]. |
| `path` | This should be the same directory like specified in Registry's `rootdirectory`. Read the [storage configuration documentation][storage-config]. |
| `path` | This should be the same directory like specified in Registry's `rootdirectory`. Read the [storage configuration documentation][storage-config]. This path needs to be readable by the GitLab user, the web-server user and the Registry user. Read more in [#container-registry-storage-path](#container-registry-storage-path). |
| `issuer` | This should be the same value as configured in Registry's `issuer`. Read the [token auth configuration documentation][token-config]. |
>**Note:**
GitLab does not ship with a Registry init file. Hence, [restarting GitLab][restart gitlab]
will not restart the Registry should you modify its settings. Read the upstream
documentation on how to achieve that.
## Container Registry domain configuration
There are two ways you can configure the Registry's external domain. Either use
the existing GitLab domain where in that case the Registry will listen on a port,
or use a completely separate domain. Since the container Registry requires a
TLS certificate, in the end it all boils down to how easy or pricey is to
get a new TLS certificate.
TLS certificate, in the end it all boils down to how easy or pricey is to get a
new TLS certificate.
Please take this into consideration before configuring the Container Registry
for the first time.
### Container Registry under existing GitLab domain
### Configure Container Registry under an existing GitLab domain
If the Registry is configured to use the existing GitLab domain, you can
expose the Registry on a port so that you can reuse the existing GitLab TLS
...
...
@@ -96,118 +107,203 @@ Registry is exposed to the outside world is `4567`, here is what you need to set
in `gitlab.rb` or `gitlab.yml` if you are using Omnibus GitLab or installed
GitLab from source respectively.
**Omnibus GitLab packages**
---
**Omnibus GitLab installations**
>**Note:**
If you are using HTTPS in your Omnibus packages, then the Registry will be
enabled by default and exposed under port `5005`. Follow the steps below only if
you want to change the default port.
1. Your `/etc/gitlab/gitlab.rb` should contain the Registry URL as well as the
path to the existing TLS certificate and key used by GitLab.
path to the existing TLS certificate and key used by GitLab: