summaryrefslogtreecommitdiff
path: root/doc/administration
diff options
context:
space:
mode:
Diffstat (limited to 'doc/administration')
-rw-r--r--doc/administration/audit_events.md3
-rw-r--r--doc/administration/auth/ldap-ee.md2
-rw-r--r--doc/administration/container_registry.md739
-rw-r--r--doc/administration/dependency_proxy.md154
-rw-r--r--doc/administration/geo/replication/docker_registry.md2
-rw-r--r--doc/administration/geo/replication/index.md6
-rw-r--r--doc/administration/index.md8
-rw-r--r--doc/administration/maven_packages.md4
-rw-r--r--doc/administration/maven_repository.md4
-rw-r--r--doc/administration/npm_registry.md4
-rw-r--r--doc/administration/packages.md179
-rw-r--r--doc/administration/packages/container_registry.md882
-rw-r--r--doc/administration/packages/dependency_proxy.md148
-rw-r--r--doc/administration/packages/img/mitmproxy-docker.pngbin0 -> 142591 bytes
-rw-r--r--doc/administration/packages/index.md175
15 files changed, 1236 insertions, 1074 deletions
diff --git a/doc/administration/audit_events.md b/doc/administration/audit_events.md
index 8075a40cae7..e961c677ca7 100644
--- a/doc/administration/audit_events.md
+++ b/doc/administration/audit_events.md
@@ -1,5 +1,5 @@
---
-last_updated: 2019-02-04
+last_updated: 2019-09-16
---
# Audit Events **(STARTER)**
@@ -77,6 +77,7 @@ From there, you can see the following actions:
- Project repository was downloaded
- Project was archived
- Project was unarchived
+- Added/removed/updated protected branches
### Instance events **(PREMIUM ONLY)**
diff --git a/doc/administration/auth/ldap-ee.md b/doc/administration/auth/ldap-ee.md
index 34f3cfa353f..d9b7d8b4382 100644
--- a/doc/administration/auth/ldap-ee.md
+++ b/doc/administration/auth/ldap-ee.md
@@ -345,7 +345,7 @@ GitLab supports LDAP groups that use member attributes:
- `memberuid`.
This means group sync supports, at least, LDAP groups with object class:
-`groupOfNames`, `posixGroup`, and `groupOfUniqueName`.
+`groupOfNames`, `posixGroup`, and `groupOfUniqueNames`.
Other object classes should work fine as long as members
are defined as one of the mentioned attributes. This also means GitLab supports
diff --git a/doc/administration/container_registry.md b/doc/administration/container_registry.md
index f5d58db0133..7a533aa9043 100644
--- a/doc/administration/container_registry.md
+++ b/doc/administration/container_registry.md
@@ -1,736 +1,5 @@
-# GitLab Container Registry administration
+---
+redirect_to: 'packages/container_registry.md'
+---
-> - [Introduced][ce-4040] in GitLab 8.8.
-> - Container Registry manifest `v1` support was added in GitLab 8.9 to support
-> Docker versions earlier than 1.10.
-> - This document is about the admin guide. To learn how to use GitLab Container
-> Registry [user documentation](../user/project/container_registry.md).
-
-With the Container Registry integrated into GitLab, every project can have its
-own space to store its Docker images.
-
-You can read more about the Container Registry at
-<https://docs.docker.com/registry/introduction/>.
-
-## Enable the Container Registry
-
-**Omnibus GitLab installations**
-
-All you have to do is configure the domain name under which the Container
-Registry will listen to. Read
-[#container-registry-domain-configuration](#container-registry-domain-configuration)
-and pick one of the two options that fits your case.
-
->**Note:**
-The container registry works under HTTPS by default. Using HTTP is possible
-but not recommended and out of the scope of this document.
-Read the [insecure Registry documentation][docker-insecure] if you want to
-implement this.
-
-**Installations from source**
-
-If you have installed GitLab from source:
-
-1. You will have to [install Registry][registry-deploy] by yourself.
-1. After the installation is complete, you will have to configure the Registry's
- settings in `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] and edit it to match the
- `host`, `port` and TLS certs paths.
-
-The contents of `gitlab.yml` are:
-
-```
-registry:
- enabled: true
- host: registry.gitlab.example.com
- port: 5005
- api_url: http://localhost:5000/
- key: config/registry.key
- path: shared/registry
- issuer: gitlab-issuer
-```
-
-where:
-
-| Parameter | Description |
-| --------- | ----------- |
-| `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` | 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]. 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:**
-A Registry init file is not shipped with GitLab if you install it from source.
-Hence, [restarting GitLab][restart gitlab] will not restart the Registry should
-you modify its settings. Read the upstream documentation on how to achieve that.
-
-At the **absolute** minimum, make sure your [Registry configuration][registry-auth]
-has `container_registry` as the service and `https://gitlab.example.com/jwt/auth`
-as the realm:
-
-```
-auth:
- token:
- realm: https://gitlab.example.com/jwt/auth
- service: container_registry
- issuer: gitlab-issuer
- rootcertbundle: /root/certs/certbundle
-```
-
-CAUTION: **Caution:**
-If `auth` is not set up, users will be able to pull docker images without authentication.
-
-## Container Registry domain configuration
-
-There are two ways you can configure the Registry's external domain.
-
-- Either [use the existing GitLab domain][existing-domain] where in that case
- the Registry will have to listen on a port and reuse GitLab's TLS certificate,
-- or [use a completely separate domain][new-domain] with a new TLS certificate
- for that 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 one.
-
-Please take this into consideration before configuring the Container Registry
-for the first time.
-
-### 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
-certificate.
-
-Assuming that the GitLab domain is `https://gitlab.example.com` and the port the
-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.
-
->**Note:**
-Be careful to choose a port different than the one that Registry listens to (`5000` by default),
-otherwise you will run into conflicts.
-
-**Omnibus GitLab installations**
-
-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:
-
- ```ruby
- registry_external_url 'https://gitlab.example.com:4567'
- ```
-
- Note how the `registry_external_url` is listening on HTTPS under the
- existing GitLab URL, but on a different port.
-
- If your TLS certificate is not in `/etc/gitlab/ssl/gitlab.example.com.crt`
- and key not in `/etc/gitlab/ssl/gitlab.example.com.key` uncomment the lines
- below:
-
- ```ruby
- registry_nginx['ssl_certificate'] = "/path/to/certificate.pem"
- registry_nginx['ssl_certificate_key'] = "/path/to/certificate.key"
- ```
-
-1. Save the file and [reconfigure GitLab][] for the changes to take effect.
-
-1. Validate using:
-
- ```sh
- openssl s_client -showcerts -servername gitlab.example.com -connect gitlab.example.com:443 > cacert.pem
- ```
-
-NOTE: **Note:**
-If your certificate provider provides the CA Bundle certificates, append them to the TLS certificate file.
-
-**Installations from source**
-
-1. Open `/home/git/gitlab/config/gitlab.yml`, find the `registry` entry and
- configure it with the following settings:
-
- ```
- registry:
- enabled: true
- host: gitlab.example.com
- port: 4567
- ```
-
-1. Save the file and [restart GitLab][] for the changes to take effect.
-1. Make the relevant changes in NGINX as well (domain, port, TLS certificates path).
-
-Users should now be able to login to the Container Registry with their GitLab
-credentials using:
-
-```bash
-docker login gitlab.example.com:4567
-```
-
-### Configure Container Registry under its own domain
-
-If the Registry is configured to use its own domain, you will need a TLS
-certificate for that specific domain (e.g., `registry.example.com`) or maybe
-a wildcard certificate if hosted under a subdomain of your existing GitLab
-domain (e.g., `registry.gitlab.example.com`).
-
-NOTE: **Note:**
-As well as manually generated SSL certificates (explained here), certificates automatically
-generated by Let's Encrypt are also [supported in Omnibus installs](https://docs.gitlab.com/omnibus/settings/ssl.html#host-services).
-
-Let's assume that you want the container Registry to be accessible at
-`https://registry.gitlab.example.com`.
-
-**Omnibus GitLab installations**
-
-1. Place your TLS certificate and key in
- `/etc/gitlab/ssl/registry.gitlab.example.com.crt` and
- `/etc/gitlab/ssl/registry.gitlab.example.com.key` and make sure they have
- correct permissions:
-
- ```bash
- chmod 600 /etc/gitlab/ssl/registry.gitlab.example.com.*
- ```
-
-1. Once the TLS certificate is in place, edit `/etc/gitlab/gitlab.rb` with:
-
- ```ruby
- registry_external_url 'https://registry.gitlab.example.com'
- ```
-
- Note how the `registry_external_url` is listening on HTTPS.
-
-1. Save the file and [reconfigure GitLab][] for the changes to take effect.
-
-> **Note:**
-If you have a [wildcard certificate][], you need to specify the path to the
-certificate in addition to the URL, in this case `/etc/gitlab/gitlab.rb` will
-look like:
->
-> ```ruby
-> registry_nginx['ssl_certificate'] = "/etc/gitlab/ssl/certificate.pem"
-> registry_nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/certificate.key"
-> ```
-
-**Installations from source**
-
-1. Open `/home/git/gitlab/config/gitlab.yml`, find the `registry` entry and
- configure it with the following settings:
-
- ```yaml
- registry:
- enabled: true
- host: registry.gitlab.example.com
- ```
-
-1. Save the file and [restart GitLab][] for the changes to take effect.
-1. Make the relevant changes in NGINX as well (domain, port, TLS certificates path).
-
-Users should now be able to login to the Container Registry using their GitLab
-credentials:
-
-```bash
-docker login registry.gitlab.example.com
-```
-
-## Disable Container Registry site-wide
-
->**Note:**
-Disabling the Registry in the Rails GitLab application as set by the following
-steps, will not remove any existing Docker images. This is handled by the
-Registry application itself.
-
-**Omnibus GitLab**
-
-1. Open `/etc/gitlab/gitlab.rb` and set `registry['enable']` to `false`:
-
- ```ruby
- registry['enable'] = false
- ```
-
-1. Save the file and [reconfigure GitLab][] for the changes to take effect.
-
-**Installations from source**
-
-1. Open `/home/git/gitlab/config/gitlab.yml`, find the `registry` entry and
- set `enabled` to `false`:
-
- ```yaml
- registry:
- enabled: false
- ```
-
-1. Save the file and [restart GitLab][] for the changes to take effect.
-
-## Disable Container Registry for new projects site-wide
-
-If the Container Registry is enabled, then it will be available on all new
-projects. To disable this function and let the owners of a project to enable
-the Container Registry by themselves, follow the steps below.
-
-**Omnibus GitLab installations**
-
-1. Edit `/etc/gitlab/gitlab.rb` and add the following line:
-
- ```ruby
- gitlab_rails['gitlab_default_projects_features_container_registry'] = false
- ```
-
-1. Save the file and [reconfigure GitLab][] for the changes to take effect.
-
-**Installations from source**
-
-1. Open `/home/git/gitlab/config/gitlab.yml`, find the `default_projects_features`
- entry and configure it so that `container_registry` is set to `false`:
-
- ```yaml
- ## Default project features settings
- default_projects_features:
- issues: true
- merge_requests: true
- wiki: true
- snippets: false
- builds: true
- container_registry: false
- ```
-
-1. Save the file and [restart GitLab][] for the changes to take effect.
-
-## Container Registry storage path
-
->**Note:**
-For configuring storage in the cloud instead of the filesystem, see the
-[storage driver configuration](#container-registry-storage-driver).
-
-If you want to store your images on the filesystem, you can change the storage
-path for the Container Registry, follow the steps below.
-
-This path is accessible to:
-
-- the user running the Container Registry daemon,
-- the user running GitLab
-
-> **Warning** You should confirm that all GitLab, Registry and web server users
-have access to this directory.
-
-**Omnibus GitLab installations**
-
-The default location where images are stored in Omnibus, is
-`/var/opt/gitlab/gitlab-rails/shared/registry`. To change it:
-
-1. Edit `/etc/gitlab/gitlab.rb`:
-
- ```ruby
- gitlab_rails['registry_path'] = "/path/to/registry/storage"
- ```
-
-1. Save the file and [reconfigure GitLab][] for the changes to take effect.
-
-**Installations from source**
-
-The default location where images are stored in source installations, is
-`/home/git/gitlab/shared/registry`. To change it:
-
-1. Open `/home/git/gitlab/config/gitlab.yml`, find the `registry` entry and
- change the `path` setting:
-
- ```yaml
- registry:
- path: shared/registry
- ```
-
-1. Save the file and [restart GitLab][] for the changes to take effect.
-
-## Container Registry storage driver
-
-You can configure the Container Registry to use a different storage backend by
-configuring a different storage driver. By default the GitLab Container Registry
-is configured to use the filesystem driver, which makes use of [storage path](#container-registry-storage-path)
-configuration.
-
-NOTE: **Note:** Enabling a storage driver other than `filesystem` would mean
-that your Docker client needs to be able to access the storage backend directly.
-In that case, you must use an address that resolves and is accessible outside GitLab server.
-
-The different supported drivers are:
-
-| Driver | Description |
-|------------|-------------------------------------|
-| filesystem | Uses a path on the local filesystem |
-| azure | Microsoft Azure Blob Storage |
-| gcs | Google Cloud Storage |
-| s3 | Amazon Simple Storage Service. Be sure to configure your storage bucket with the correct [S3 Permission Scopes](https://docs.docker.com/registry/storage-drivers/s3/#s3-permission-scopes). |
-| swift | OpenStack Swift Object Storage |
-| oss | Aliyun OSS |
-
-Read more about the individual driver's config options in the
-[Docker Registry docs][storage-config].
-
-CAUTION: **Warning:** GitLab will not backup Docker images that are not stored on the
-filesystem. Remember to enable backups with your object storage provider if
-desired.
-
-NOTE: **Note:**
-`regionendpoint` is only required when configuring an S3 compatible service such as Minio. It takes a URL such as `http://127.0.0.1:9000`.
-
-**Omnibus GitLab installations**
-
-To configure the `s3` storage driver in Omnibus:
-
-1. Edit `/etc/gitlab/gitlab.rb`:
-
- ```ruby
- registry['storage'] = {
- 's3' => {
- 'accesskey' => 's3-access-key',
- 'secretkey' => 's3-secret-key-for-access-key',
- 'bucket' => 'your-s3-bucket',
- 'region' => 'your-s3-region',
- 'regionendpoint' => 'your-s3-regionendpoint'
- }
- }
- ```
-
-1. Save the file and [reconfigure GitLab][] for the changes to take effect.
-
-**Installations from source**
-
-Configuring the storage driver is done in your registry config YML file created
-when you [deployed your docker registry][registry-deploy].
-
-`s3` storage driver example:
-
-```yml
-storage:
- s3:
- accesskey: 'AKIAKIAKI'
- secretkey: 'secret123'
- bucket: 'gitlab-registry-bucket-AKIAKIAKI'
- region: 'your-s3-region'
- regionendpoint: 'your-s3-regionendpoint'
- cache:
- blobdescriptor: inmemory
- delete:
- enabled: true
-```
-
-## Change the registry's internal port
-
-> **Note:**
-This is not to be confused with the port that GitLab itself uses to expose
-the Registry to the world.
-
-The Registry server listens on localhost at port `5000` by default,
-which is the address for which the Registry server should accept connections.
-In the examples below we set the Registry's port to `5001`.
-
-**Omnibus GitLab**
-
-1. Open `/etc/gitlab/gitlab.rb` and set `registry['registry_http_addr']`:
-
- ```ruby
- registry['registry_http_addr'] = "localhost:5001"
- ```
-
-1. Save the file and [reconfigure GitLab][] for the changes to take effect.
-
-**Installations from source**
-
-1. Open the configuration file of your Registry server and edit the
- [`http:addr`][registry-http-config] value:
-
- ```yaml
- http
- addr: localhost:5001
- ```
-
-1. Save the file and restart the Registry server.
-
-## Disable Container Registry per project
-
-If Registry is enabled in your GitLab instance, but you don't need it for your
-project, you can disable it from your project's settings. Read the user guide
-on how to achieve that.
-
-## Disable Container Registry but use GitLab as an auth endpoint
-
-**Omnibus GitLab**
-
-You can use GitLab as an auth endpoint and use a non-bundled Container Registry.
-
-1. Open `/etc/gitlab/gitlab.rb` and set necessary configurations:
-
- ```ruby
- gitlab_rails['registry_enabled'] = true
- gitlab_rails['registry_host'] = "registry.gitlab.example.com"
- gitlab_rails['registry_port'] = "5005"
- gitlab_rails['registry_api_url'] = "http://localhost:5000"
- gitlab_rails['registry_path'] = "/var/opt/gitlab/gitlab-rails/shared/registry"
- gitlab_rails['registry_issuer'] = "omnibus-gitlab-issuer"
- ```
-
-1. A certificate keypair is required for GitLab and the Container Registry to
- communicate securely. By default Omnibus GitLab will generate one keypair,
- which is saved to `/var/opt/gitlab/gitlab-rails/etc/gitlab-registry.key`.
- When using a non-bundled Container Registry, you will need to supply a
- custom certificate key. To do that, add the following to
- `/etc/gitlab/gitlab.rb`
-
- ```ruby
- gitlab_rails['registry_key_path'] = "/custom/path/to/registry-key.key"
- # registry['internal_key'] should contain the contents of the custom key
- # file. Line breaks in the key file should be marked using `\n` character
- # Example:
- registry['internal_key'] = "---BEGIN RSA PRIVATE KEY---\nMIIEpQIBAA\n"
- ```
-
- **Note:** The file specified at `registry_key_path` gets populated with the
- content specified by `internal_key`, each time reconfigure is executed. If
- no file is specified, Omnibus GitLab will default it to
- `/var/opt/gitlab/gitlab-rails/etc/gitlab-registry.key` and will populate
- it.
-
-1. Save the file and [reconfigure GitLab][] for the changes to take effect.
-
-**Installations from source**
-
-1. Open `/home/git/gitlab/config/gitlab.yml`, and edit the configuration settings under `registry`:
-
- ```yaml
- ## Container Registry
-
- registry:
- enabled: true
- host: "registry.gitlab.example.com"
- port: "5005"
- api_url: "http://localhost:5000"
- path: /var/opt/gitlab/gitlab-rails/shared/registry
- key: /var/opt/gitlab/gitlab-rails/certificate.key
- issuer: omnibus-gitlab-issuer
- ```
-
-1. Save the file and [restart GitLab][] for the changes to take effect.
-
-## Storage limitations
-
-Currently, there is no storage limitation, which means a user can upload an
-infinite amount of Docker images with arbitrary sizes. This setting will be
-configurable in future releases.
-
-## Configure Container Registry notifications
-
-You can configure the Container Registry to send webhook notifications in
-response to events happening within the registry.
-
-Read more about the Container Registry notifications config options in the
-[Docker Registry notifications documentation][notifications-config].
-
->**Note:**
-Multiple endpoints can be configured for the Container Registry.
-
-**Omnibus GitLab installations**
-
-To configure a notification endpoint in Omnibus:
-
-1. Edit `/etc/gitlab/gitlab.rb`:
-
- ```ruby
- registry['notifications'] = [
- {
- 'name' => 'test_endpoint',
- 'url' => 'https://gitlab.example.com/notify',
- 'timeout' => '500ms',
- 'threshold' => 5,
- 'backoff' => '1s',
- 'headers' => {
- "Authorization" => ["AUTHORIZATION_EXAMPLE_TOKEN"]
- }
- }
- ]
- ```
-
-1. Save the file and [reconfigure GitLab][] for the changes to take effect.
-
-**Installations from source**
-
-Configuring the notification endpoint is done in your registry config YML file created
-when you [deployed your docker registry][registry-deploy].
-
-Example:
-
-```
-notifications:
- endpoints:
- - name: alistener
- disabled: false
- url: https://my.listener.com/event
- headers: <http.Header>
- timeout: 500
- threshold: 5
- backoff: 1000
-```
-
-## Troubleshooting
-
-### Using self-signed certificates with Container Registry
-
-If you're using a self-signed certificate with your Container Registry, you
-might encounter issues during the CI jobs like the following:
-
-```
-Error response from daemon: Get registry.example.com/v1/users/: x509: certificate signed by unknown authority
-```
-
-The Docker daemon running the command expects a cert signed by a recognized CA,
-thus the error above.
-
-While GitLab doesn't support using self-signed certificates with Container Registry out of the box, it is possible to make it work by [instructing the docker-daemon to trust the self-signed certificates][docker-insecure-self-signed], mounting the docker-daemon and setting `privileged = false` in the runner's `config.toml`. Setting `privileged = true` takes precedence over the docker-daemon.
-
-```
- [runners.docker]
- image = "ruby:2.1"
- privileged = false
- volumes = ["/var/run/docker.sock:/var/run/docker.sock", "/cache"]
-```
-
-Additional information about this: [issue 18239][ce-18239].
-
-### AWS S3 with the GitLab registry error when pushing large images
-
-When using AWS S3 with the GitLab registry, an error may occur when pushing
-large images. Look in the Registry log for the following error:
-
-```
-level=error msg="response completed with error" err.code=unknown err.detail="unexpected EOF" err.message="unknown error"
-```
-
-To resolve the error specify a `chunksize` value in the Registry configuration.
-Start with a value between `25000000` (25MB) and `50000000` (50MB).
-
-**For Omnibus installations**
-
-1. Edit `/etc/gitlab/gitlab.rb`:
-
- ```ruby
- registry['storage'] = {
- 's3' => {
- 'accesskey' => 'AKIAKIAKI',
- 'secretkey' => 'secret123',
- 'bucket' => 'gitlab-registry-bucket-AKIAKIAKI',
- 'chunksize' => 25000000
- }
- }
- ```
-
-1. Save the file and [reconfigure GitLab][] for the changes to take effect.
-
-**For installations from source**
-
-1. Edit `config/gitlab.yml`:
-
- ```yaml
- storage:
- s3:
- accesskey: 'AKIAKIAKI'
- secretkey: 'secret123'
- bucket: 'gitlab-registry-bucket-AKIAKIAKI'
- chunksize: 25000000
- ```
-
-1. Save the file and [restart GitLab][] for the changes to take effect.
-
-### Supporting older Docker clients
-
-As of GitLab 11.9, we began shipping version 2.7.1 of the Docker container registry, which disables the schema1 manifest by default. If you are still using older Docker clients (1.9 or older), you may experience an error pushing images. See [omnibus-4145](https://gitlab.com/gitlab-org/omnibus-gitlab/issues/4145) for more details.
-
-You can add a configuration option for backwards compatibility.
-
-**For Omnibus installations**
-
-1. Edit `/etc/gitlab/gitlab.rb`:
-
- ```ruby
- registry['compatibility_schema1_enabled'] = true
- ```
-
-1. Save the file and [reconfigure GitLab][] for the changes to take effect.
-
-**For installations from source**
-
-1. Edit the YML configuration file you created when you [deployed the registry][registry-deploy]. Add the following snippet:
-
- ```yaml
- compatibility:
- schema1:
- enabled: true
- ```
-
-1. Restart the registry for the changes to take affect.
-
-### Docker connection error
-
-A Docker connection error can occur when there are special characters in either the group,
-project or branch name. Special characters can include:
-
-- Leading underscore
-- Trailing hyphen/dash
-- Double hyphen/dash
-
-To get around this, you can [change the group path](../user/group/index.md#changing-a-groups-path),
-[change the project path](../user/project/settings/index.md#renaming-a-repository) or change the
-branch name. Another option is to create a [push rule](../push_rules/push_rules.html) to prevent
-this at the instance level.
-
-### Image push errors
-
-When getting errors or "retrying" loops in an attempt to push an image but `docker login` works fine,
-there is likely an issue with the headers forwarded to the registry by NGINX. The default recommended
-NGINX configurations should handle this, but it might occur in custom setups where the SSL is
-offloaded to a third party reverse proxy.
-
-This problem was discussed in a [docker project issue][docker-image-push-issue] and a simple solution
-would be to enable relative urls in the registry.
-
-**For Omnibus installations**
-
-1. Edit `/etc/gitlab/gitlab.rb`:
-
- ```ruby
- registry['env'] = {
- "REGISTRY_HTTP_RELATIVEURLS" => true
- }
- ```
-
-1. Save the file and [reconfigure GitLab][] for the changes to take effect.
-
-**For installations from source**
-
-1. Edit the YML configuration file you created when you [deployed the registry][registry-deploy]. Add the following snippet:
-
- ```yaml
- http:
- relativeurls: true
- ```
-
-1. Restart the registry for the changes to take affect.
-
-[ce-18239]: https://gitlab.com/gitlab-org/gitlab-ce/issues/18239
-[docker-insecure-self-signed]: https://docs.docker.com/registry/insecure/#use-self-signed-certificates
-[reconfigure gitlab]: restart_gitlab.md#omnibus-gitlab-reconfigure
-[restart gitlab]: restart_gitlab.md#installations-from-source
-[wildcard certificate]: https://en.wikipedia.org/wiki/Wildcard_certificate
-[ce-4040]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4040
-[docker-insecure]: https://docs.docker.com/registry/insecure/
-[registry-deploy]: https://docs.docker.com/registry/deploying/
-[storage-config]: https://docs.docker.com/registry/configuration/#storage
-[registry-http-config]: https://docs.docker.com/registry/configuration/#http
-[registry-auth]: https://docs.docker.com/registry/configuration/#auth
-[token-config]: https://docs.docker.com/registry/configuration/#token
-[8-8-docs]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-8-stable/doc/administration/container_registry.md
-[registry-ssl]: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/support/nginx/registry-ssl
-[existing-domain]: #configure-container-registry-under-an-existing-gitlab-domain
-[new-domain]: #configure-container-registry-under-its-own-domain
-[notifications-config]: https://docs.docker.com/registry/notifications/
-[registry-notifications-config]: https://docs.docker.com/registry/configuration/#notifications
-[docker-image-push-issue]: https://github.com/docker/distribution/issues/970
+This document was moved to [another location](packages/container_registry.md).
diff --git a/doc/administration/dependency_proxy.md b/doc/administration/dependency_proxy.md
index 5153666705f..4683565998a 100644
--- a/doc/administration/dependency_proxy.md
+++ b/doc/administration/dependency_proxy.md
@@ -1,151 +1,5 @@
-# GitLab Dependency Proxy administration **(PREMIUM ONLY)**
+---
+redirect_to: 'packages/dependency_proxy.md'
+---
-> [Introduced](https://gitlab.com/gitlab-org/gitlab-ee/issues/7934) in [GitLab Premium](https://about.gitlab.com/pricing/) 11.11.
-
-GitLab can be utilized as a dependency proxy for a variety of common package managers.
-
-This is the administration documentation. If you want to learn how to use the
-dependency proxies, see the [user guide](../user/group/dependency_proxy/index.md).
-
-## Enabling the Dependency Proxy feature
-
-NOTE: **Note:**
-Dependency proxy requires the Puma web server to be enabled.
-Puma support is EXPERIMENTAL at this time.
-
-To enable the Dependency proxy feature:
-
-**Omnibus GitLab installations**
-
-1. Edit `/etc/gitlab/gitlab.rb` and add the following line:
-
- ```ruby
- gitlab_rails['dependency_proxy_enabled'] = true
- ```
-
-1. Save the file and [reconfigure GitLab][] for the changes to take effect.
-1. Enable the [Puma web server](https://docs.gitlab.com/omnibus/settings/puma.html).
-
-**Installations from source**
-
-1. After the installation is complete, you will have to configure the `dependency_proxy`
- section in `config/gitlab.yml`. Set to `true` to enable it:
-
- ```yaml
- dependency_proxy:
- enabled: true
- ```
-
-1. [Restart GitLab] for the changes to take effect.
-1. Enable the [Puma web server](../install/installation.md#using-puma).
-
-## Changing the storage path
-
-By default, the dependency proxy files are stored locally, but you can change the default
-local location or even use object storage.
-
-### Changing the local storage path
-
-The dependency proxy files for Omnibus GitLab installations are stored under
-`/var/opt/gitlab/gitlab-rails/shared/dependency_proxy/` and for source
-installations under `shared/dependency_proxy/` (relative to the Git home directory).
-To change the local storage path:
-
-**Omnibus GitLab installations**
-
-1. Edit `/etc/gitlab/gitlab.rb` and add the following line:
-
- ```ruby
- gitlab_rails['dependency_proxy_storage_path'] = "/mnt/dependency_proxy"
- ```
-
-1. Save the file and [reconfigure GitLab][] for the changes to take effect.
-
-**Installations from source**
-
-1. Edit the `dependency_proxy` section in `config/gitlab.yml`:
-
- ```yaml
- dependency_proxy:
- enabled: true
- storage_path: shared/dependency_proxy
- ```
-
-1. [Restart GitLab] for the changes to take effect.
-
-### Using object storage
-
-Instead of relying on the local storage, you can use an object storage to
-upload the blobs of the dependency proxy:
-
-**Omnibus GitLab installations**
-
-1. Edit `/etc/gitlab/gitlab.rb` and add the following lines (uncomment where
- necessary):
-
- ```ruby
- gitlab_rails['dependency_proxy_enabled'] = true
- gitlab_rails['dependency_proxy_storage_path'] = "/var/opt/gitlab/gitlab-rails/shared/dependency_proxy"
- gitlab_rails['dependency_proxy_object_store_enabled'] = true
- gitlab_rails['dependency_proxy_object_store_remote_directory'] = "dependency_proxy" # The bucket name.
- gitlab_rails['dependency_proxy_object_store_direct_upload'] = false # Use Object Storage directly for uploads instead of background uploads if enabled (Default: false).
- gitlab_rails['dependency_proxy_object_store_background_upload'] = true # Temporary option to limit automatic upload (Default: true).
- gitlab_rails['dependency_proxy_object_store_proxy_download'] = false # Passthrough all downloads via GitLab instead of using Redirects to Object Storage.
- gitlab_rails['dependency_proxy_object_store_connection'] = {
- ##
- ## If the provider is AWS S3, uncomment the following
- ##
- #'provider' => 'AWS',
- #'region' => 'eu-west-1',
- #'aws_access_key_id' => 'AWS_ACCESS_KEY_ID',
- #'aws_secret_access_key' => 'AWS_SECRET_ACCESS_KEY',
- ##
- ## If the provider is other than AWS (an S3-compatible one), uncomment the following
- ##
- #'host' => 's3.amazonaws.com',
- #'aws_signature_version' => 4 # For creation of signed URLs. Set to 2 if provider does not support v4.
- #'endpoint' => 'https://s3.amazonaws.com' # Useful for S3-compliant services such as DigitalOcean Spaces.
- #'path_style' => false # If true, use 'host/bucket_name/object' instead of 'bucket_name.host/object'.
- }
- ```
-
-1. Save the file and [reconfigure GitLab][] for the changes to take effect.
-
-**Installations from source**
-
-1. Edit the `dependency_proxy` section in `config/gitlab.yml` (uncomment where necessary):
-
- ```yaml
- dependency_proxy:
- enabled: true
- ##
- ## The location where build dependency_proxy are stored (default: shared/dependency_proxy).
- ##
- #storage_path: shared/dependency_proxy
- object_store:
- enabled: false
- remote_directory: dependency_proxy # The bucket name.
- #direct_upload: false # Use Object Storage directly for uploads instead of background uploads if enabled (Default: false).
- #background_upload: true # Temporary option to limit automatic upload (Default: true).
- #proxy_download: false # Passthrough all downloads via GitLab instead of using Redirects to Object Storage.
- connection:
- ##
- ## If the provider is AWS S3, uncomment the following
- ##
- #provider: AWS
- #region: us-east-1
- #aws_access_key_id: AWS_ACCESS_KEY_ID
- #aws_secret_access_key: AWS_SECRET_ACCESS_KEY
- ##
- ## If the provider is other than AWS (an S3-compatible one), uncomment the following
- ##
- #host: 's3.amazonaws.com' # default: s3.amazonaws.com.
- #aws_signature_version: 4 # For creation of signed URLs. Set to 2 if provider does not support v4.
- #endpoint: 'https://s3.amazonaws.com' # Useful for S3-compliant services such as DigitalOcean Spaces.
- #path_style: false # If true, use 'host/bucket_name/object' instead of 'bucket_name.host/object'.
- ```
-
-1. [Restart GitLab] for the changes to take effect.
-
-[reconfigure gitlab]: restart_gitlab.md#omnibus-gitlab-reconfigure "How to reconfigure Omnibus GitLab"
-[restart gitlab]: restart_gitlab.md#omnibus-gitlab-reconfigure "How to reconfigure Omnibus GitLab"
+This document was moved to [another location](packages/dependency_proxy.md).
diff --git a/doc/administration/geo/replication/docker_registry.md b/doc/administration/geo/replication/docker_registry.md
index b326717205e..537f8f57420 100644
--- a/doc/administration/geo/replication/docker_registry.md
+++ b/doc/administration/geo/replication/docker_registry.md
@@ -11,7 +11,7 @@ Registry on the **primary** node, you can use the same storage for a **secondary
Docker Registry as well. For more information, read the
[Load balancing considerations](https://docs.docker.com/registry/deploying/#load-balancing-considerations)
when deploying the Registry, and how to set up the storage driver for GitLab's
-integrated [Container Registry](../../container_registry.md#container-registry-storage-driver).
+integrated [Container Registry](../../packages/container_registry.md#container-registry-storage-driver).
## Replicating Docker Registry
diff --git a/doc/administration/geo/replication/index.md b/doc/administration/geo/replication/index.md
index 1d50c924f6e..bbad9f455fe 100644
--- a/doc/administration/geo/replication/index.md
+++ b/doc/administration/geo/replication/index.md
@@ -274,9 +274,9 @@ You can keep track of the progress to include the missing items in:
| [Server-side Git Hooks](../../custom_hooks.md) | No | No |
| [Elasticsearch integration](../../../integration/elasticsearch.md) | No | No |
| [GitLab Pages](../../pages/index.md) | No | No |
-| [Container Registry](../../container_registry.md) | Yes | No |
-| [NPM Registry](../../npm_registry.md) | No | No |
-| [Maven Packages](../../maven_packages.md) | No | No |
+| [Container Registry](../../packages/container_registry.md) | Yes | No |
+| [NPM Registry](../../../user/packages/npm_registry/index.md) | No | No |
+| [Maven Packages](../../../user/packages/maven_repository/index.md) | No | No |
| [External merge request diffs](../../merge_request_diffs.md) | No, if they are on-disk | No |
| Content in object storage ([track progress](https://gitlab.com/groups/gitlab-org/-/epics/1526)) | No | No |
diff --git a/doc/administration/index.md b/doc/administration/index.md
index df3501ae950..731c25cd3d8 100644
--- a/doc/administration/index.md
+++ b/doc/administration/index.md
@@ -128,13 +128,17 @@ Learn how to install, configure, update, and maintain your GitLab instance.
## Project settings
-- [Container Registry](container_registry.md): Configure Container Registry with GitLab.
- [Issue closing pattern](issue_closing_pattern.md): Customize how to close an issue from commit messages.
- [Gitaly](gitaly/index.md): Configuring Gitaly, GitLab's Git repository storage service.
- [Default labels](../user/admin_area/labels.md): Create labels that will be automatically added to every new project.
- [Restrict the use of public or internal projects](../public_access/public_access.md#restricting-the-use-of-public-or-internal-projects): Restrict the use of visibility levels for users when they create a project or a snippet.
- [Custom project templates](../user/admin_area/custom_project_templates.md): Configure a set of projects to be used as custom templates when creating a new project. **(PREMIUM ONLY)**
-- [Packages](packages.md): Enable GitLab to act as a Maven repository or NPM registry. **(PREMIUM ONLY)**
+
+## Package Registry administration
+
+- [Container Registry](packages/container_registry.md): Configure Container Registry with GitLab.
+- [Package Registry](packages/index.md): Enable GitLab to act as an NPM Registry and a Maven Repository. **(PREMIUM ONLY)**
+- [Dependency Proxy](packages/dependency_proxy.md): Configure the Dependency Proxy, a local proxy for frequently used upstream images/packages. **(PREMIUM ONLY)**
### Repository settings
diff --git a/doc/administration/maven_packages.md b/doc/administration/maven_packages.md
index d8551f64ece..cdcce79f8f9 100644
--- a/doc/administration/maven_packages.md
+++ b/doc/administration/maven_packages.md
@@ -1,5 +1,5 @@
---
-redirect_to: 'packages.md'
+redirect_to: 'packages/index.md'
---
-This document was moved to [another location](packages.md).
+This document was moved to [another location](packages/index.md).
diff --git a/doc/administration/maven_repository.md b/doc/administration/maven_repository.md
index d8551f64ece..cdcce79f8f9 100644
--- a/doc/administration/maven_repository.md
+++ b/doc/administration/maven_repository.md
@@ -1,5 +1,5 @@
---
-redirect_to: 'packages.md'
+redirect_to: 'packages/index.md'
---
-This document was moved to [another location](packages.md).
+This document was moved to [another location](packages/index.md).
diff --git a/doc/administration/npm_registry.md b/doc/administration/npm_registry.md
index d8551f64ece..cdcce79f8f9 100644
--- a/doc/administration/npm_registry.md
+++ b/doc/administration/npm_registry.md
@@ -1,5 +1,5 @@
---
-redirect_to: 'packages.md'
+redirect_to: 'packages/index.md'
---
-This document was moved to [another location](packages.md).
+This document was moved to [another location](packages/index.md).
diff --git a/doc/administration/packages.md b/doc/administration/packages.md
index 1628b6d6f91..cdcce79f8f9 100644
--- a/doc/administration/packages.md
+++ b/doc/administration/packages.md
@@ -1,176 +1,5 @@
-# GitLab Packages administration **(PREMIUM ONLY)**
+---
+redirect_to: 'packages/index.md'
+---
-GitLab Packages allows organizations to utilize GitLab as a private repository
-for a variety of common package managers. Users are able to build and publish
-packages, which can be easily consumed as a dependency in downstream projects.
-
-The Packages feature allows GitLab to act as a repository for the following:
-
-| Software repository | Description | Available in GitLab version |
-| ------------------- | ----------- | --------------------------- |
-| [Maven Repository](../user/project/packages/maven_repository.md) | The GitLab Maven Repository enables every project in GitLab to have its own space to store [Maven](https://maven.apache.org/) packages. | 11.3+ |
-| [NPM Registry](../user/project/packages/npm_registry.md) | The GitLab NPM Registry enables every project in GitLab to have its own space to store [NPM](https://www.npmjs.com/) packages. | 11.7+ |
-
-Don't you see your package management system supported yet?
-Please consider contributing
-to GitLab. This [development documentation](../development/packages.md) will guide you through the process.
-
-## Enabling the Packages feature
-
-NOTE: **Note:**
-After the Packages feature is enabled, the repositories are available
-for all new projects by default. To enable it for existing projects, users will
-have to explicitly do so in the project's settings.
-
-To enable the Packages feature:
-
-**Omnibus GitLab installations**
-
-1. Edit `/etc/gitlab/gitlab.rb` and add the following line:
-
- ```ruby
- gitlab_rails['packages_enabled'] = true
- ```
-
-1. Save the file and [reconfigure GitLab][] for the changes to take effect.
-
-**Installations from source**
-
-1. After the installation is complete, you will have to configure the `packages`
- section in `config/gitlab.yml`. Set to `true` to enable it:
-
- ```yaml
- packages:
- enabled: true
- ```
-
-1. [Restart GitLab] for the changes to take effect.
-
-## Changing the storage path
-
-By default, the packages are stored locally, but you can change the default
-local location or even use object storage.
-
-### Changing the local storage path
-
-The packages for Omnibus GitLab installations are stored under
-`/var/opt/gitlab/gitlab-rails/shared/packages/` and for source
-installations under `shared/packages/` (relative to the Git homedir).
-To change the local storage path:
-
-**Omnibus GitLab installations**
-
-1. Edit `/etc/gitlab/gitlab.rb` and add the following line:
-
- ```ruby
- gitlab_rails['packages_storage_path'] = "/mnt/packages"
- ```
-
-1. Save the file and [reconfigure GitLab][] for the changes to take effect.
-
-**Installations from source**
-
-1. Edit the `packages` section in `config/gitlab.yml`:
-
- ```yaml
- packages:
- enabled: true
- storage_path: shared/packages
- ```
-
-1. [Restart GitLab] for the changes to take effect.
-
-### Using object storage
-
-Instead of relying on the local storage, you can use an object storage to
-upload packages:
-
-**Omnibus GitLab installations**
-
-1. Edit `/etc/gitlab/gitlab.rb` and add the following lines (uncomment where
- necessary):
-
- ```ruby
- gitlab_rails['packages_enabled'] = true
- gitlab_rails['packages_storage_path'] = "/var/opt/gitlab/gitlab-rails/shared/packages"
- gitlab_rails['packages_object_store_enabled'] = true
- gitlab_rails['packages_object_store_remote_directory'] = "packages" # The bucket name.
- gitlab_rails['packages_object_store_direct_upload'] = false # Use Object Storage directly for uploads instead of background uploads if enabled (Default: false).
- gitlab_rails['packages_object_store_background_upload'] = true # Temporary option to limit automatic upload (Default: true).
- gitlab_rails['packages_object_store_proxy_download'] = false # Passthrough all downloads via GitLab instead of using Redirects to Object Storage.
- gitlab_rails['packages_object_store_connection'] = {
- ##
- ## If the provider is AWS S3, uncomment the following
- ##
- #'provider' => 'AWS',
- #'region' => 'eu-west-1',
- #'aws_access_key_id' => 'AWS_ACCESS_KEY_ID',
- #'aws_secret_access_key' => 'AWS_SECRET_ACCESS_KEY',
- ##
- ## If the provider is other than AWS (an S3-compatible one), uncomment the following
- ##
- #'host' => 's3.amazonaws.com',
- #'aws_signature_version' => 4 # For creation of signed URLs. Set to 2 if provider does not support v4.
- #'endpoint' => 'https://s3.amazonaws.com' # Useful for S3-compliant services such as DigitalOcean Spaces.
- #'path_style' => false # If true, use 'host/bucket_name/object' instead of 'bucket_name.host/object'.
- }
- ```
-
-1. Save the file and [reconfigure GitLab][] for the changes to take effect.
-
-**Installations from source**
-
-1. Edit the `packages` section in `config/gitlab.yml` (uncomment where necessary):
-
- ```yaml
- packages:
- enabled: true
- ##
- ## The location where build packages are stored (default: shared/packages).
- ##
- #storage_path: shared/packages
- object_store:
- enabled: false
- remote_directory: packages # The bucket name.
- #direct_upload: false # Use Object Storage directly for uploads instead of background uploads if enabled (Default: false).
- #background_upload: true # Temporary option to limit automatic upload (Default: true).
- #proxy_download: false # Passthrough all downloads via GitLab instead of using Redirects to Object Storage.
- connection:
- ##
- ## If the provider is AWS S3, uncomment the following
- ##
- #provider: AWS
- #region: us-east-1
- #aws_access_key_id: AWS_ACCESS_KEY_ID
- #aws_secret_access_key: AWS_SECRET_ACCESS_KEY
- ##
- ## If the provider is other than AWS (an S3-compatible one), uncomment the following
- ##
- #host: 's3.amazonaws.com' # default: s3.amazonaws.com.
- #aws_signature_version: 4 # For creation of signed URLs. Set to 2 if provider does not support v4.
- #endpoint: 'https://s3.amazonaws.com' # Useful for S3-compliant services such as DigitalOcean Spaces.
- #path_style: false # If true, use 'host/bucket_name/object' instead of 'bucket_name.host/object'.
- ```
-
-1. [Restart GitLab] for the changes to take effect.
-
-### Migrating local packages to object storage
-
-After [configuring the object storage](#using-object-storage), you may use the
-following task to migrate existing packages from the local storage to the remote one.
-The processing will be done in a background worker and requires **no downtime**.
-
-For Omnibus GitLab:
-
-```sh
-sudo gitlab-rake "gitlab:packages:migrate"
-```
-
-For installations from source:
-
-```bash
-RAILS_ENV=production sudo -u git -H bundle exec rake gitlab:packages:migrate
-```
-
-[reconfigure gitlab]: restart_gitlab.md#omnibus-gitlab-reconfigure "How to reconfigure Omnibus GitLab"
-[restart gitlab]: restart_gitlab.md#omnibus-gitlab-reconfigure "How to reconfigure Omnibus GitLab"
+This document was moved to [another location](packages/index.md).
diff --git a/doc/administration/packages/container_registry.md b/doc/administration/packages/container_registry.md
new file mode 100644
index 00000000000..e3c793ee339
--- /dev/null
+++ b/doc/administration/packages/container_registry.md
@@ -0,0 +1,882 @@
+# GitLab Container Registry administration
+
+> - [Introduced](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4040) in GitLab 8.8.
+> - Container Registry manifest `v1` support was added in GitLab 8.9 to support
+> Docker versions earlier than 1.10.
+
+NOTE: **Note:**
+This document is about the admin guide. To learn how to use GitLab Container
+Registry [user documentation](../../user/packages/container_registry/index.md).
+
+With the Container Registry integrated into GitLab, every project can have its
+own space to store its Docker images.
+
+You can read more about the Docker Registry at
+<https://docs.docker.com/registry/introduction/>.
+
+## Enable the Container Registry
+
+**Omnibus GitLab installations**
+
+All you have to do is configure the domain name under which the Container
+Registry will listen to. Read
+[#container-registry-domain-configuration](#container-registry-domain-configuration)
+and pick one of the two options that fits your case.
+
+NOTE: **Note:**
+The container registry works under HTTPS by default. Using HTTP is possible
+but not recommended and out of the scope of this document.
+Read the [insecure Registry documentation](https://docs.docker.com/registry/insecure/)
+if you want to implement this.
+
+**Installations from source**
+
+If you have installed GitLab from source:
+
+1. You will have to [install Registry](https://docs.docker.com/registry/deploying/) by yourself.
+1. After the installation is complete, you will have to configure the Registry's
+ settings in `gitlab.yml` in order to enable it.
+1. Use the sample NGINX configuration file that is found under
+ [`lib/support/nginx/registry-ssl`](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/support/nginx/registry-ssl) and edit it to match the
+ `host`, `port` and TLS certs paths.
+
+The contents of `gitlab.yml` are:
+
+```yaml
+registry:
+ enabled: true
+ host: registry.gitlab.example.com
+ port: 5005
+ api_url: http://localhost:5000/
+ key: config/registry.key
+ path: shared/registry
+ issuer: gitlab-issuer
+```
+
+where:
+
+| Parameter | Description |
+| --------- | ----------- |
+| `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` | The private key location that is a pair of Registry's `rootcertbundle`. Read the [token auth configuration documentation](https://docs.docker.com/registry/configuration/#token). |
+| `path` | This should be the same directory like specified in Registry's `rootdirectory`. Read the [storage configuration documentation](https://docs.docker.com/registry/configuration/#storage). 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](https://docs.docker.com/registry/configuration/#token). |
+
+NOTE: **Note:**
+A Registry init file is not shipped with GitLab if you install it from source.
+Hence, [restarting GitLab](../restart_gitlab.md#installations-from-source) will not restart the Registry should
+you modify its settings. Read the upstream documentation on how to achieve that.
+
+At the **absolute** minimum, make sure your [Registry configuration](https://docs.docker.com/registry/configuration/#auth)
+has `container_registry` as the service and `https://gitlab.example.com/jwt/auth`
+as the realm:
+
+```yaml
+auth:
+ token:
+ realm: https://gitlab.example.com/jwt/auth
+ service: container_registry
+ issuer: gitlab-issuer
+ rootcertbundle: /root/certs/certbundle
+```
+
+CAUTION: **Caution:**
+If `auth` is not set up, users will be able to pull docker images without authentication.
+
+## Container Registry domain configuration
+
+There are two ways you can configure the Registry's external domain. Either:
+
+- [Use the existing GitLab domain](#configure-container-registry-under-an-existing-gitlab-domain) where in that case
+ the Registry will have to listen on a port and reuse GitLab's TLS certificate,
+- [Use a completely separate domain](#configure-container-registry-under-its-own-domain) with a new TLS certificate
+ for that 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 one.
+
+Please take this into consideration before configuring the Container Registry
+for the first time.
+
+### 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
+certificate.
+
+Assuming that the GitLab domain is `https://gitlab.example.com` and the port the
+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.
+
+NOTE: **Note:**
+Be careful to choose a port different than the one that Registry listens to (`5000` by default),
+otherwise you will run into conflicts.
+
+**Omnibus GitLab installations**
+
+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:
+
+ ```ruby
+ registry_external_url 'https://gitlab.example.com:4567'
+ ```
+
+ Note how the `registry_external_url` is listening on HTTPS under the
+ existing GitLab URL, but on a different port.
+
+ If your TLS certificate is not in `/etc/gitlab/ssl/gitlab.example.com.crt`
+ and key not in `/etc/gitlab/ssl/gitlab.example.com.key` uncomment the lines
+ below:
+
+ ```ruby
+ registry_nginx['ssl_certificate'] = "/path/to/certificate.pem"
+ registry_nginx['ssl_certificate_key'] = "/path/to/certificate.key"
+ ```
+
+1. Save the file and [reconfigure GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure)
+ for the changes to take effect.
+
+1. Validate using:
+
+ ```sh
+ openssl s_client -showcerts -servername gitlab.example.com -connect gitlab.example.com:443 > cacert.pem
+ ```
+
+NOTE: **Note:**
+If your certificate provider provides the CA Bundle certificates, append them to the TLS certificate file.
+
+**Installations from source**
+
+1. Open `/home/git/gitlab/config/gitlab.yml`, find the `registry` entry and
+ configure it with the following settings:
+
+ ```
+ registry:
+ enabled: true
+ host: gitlab.example.com
+ port: 4567
+ ```
+
+1. Save the file and [restart GitLab](../restart_gitlab.md#installations-from-source) for the changes to take effect.
+1. Make the relevant changes in NGINX as well (domain, port, TLS certificates path).
+
+Users should now be able to login to the Container Registry with their GitLab
+credentials using:
+
+```bash
+docker login gitlab.example.com:4567
+```
+
+### Configure Container Registry under its own domain
+
+If the Registry is configured to use its own domain, you will need a TLS
+certificate for that specific domain (e.g., `registry.example.com`) or maybe
+a wildcard certificate if hosted under a subdomain of your existing GitLab
+domain (e.g., `registry.gitlab.example.com`).
+
+NOTE: **Note:**
+As well as manually generated SSL certificates (explained here), certificates automatically
+generated by Let's Encrypt are also [supported in Omnibus installs](https://docs.gitlab.com/omnibus/settings/ssl.html#host-services).
+
+Let's assume that you want the container Registry to be accessible at
+`https://registry.gitlab.example.com`.
+
+**Omnibus GitLab installations**
+
+1. Place your TLS certificate and key in
+ `/etc/gitlab/ssl/registry.gitlab.example.com.crt` and
+ `/etc/gitlab/ssl/registry.gitlab.example.com.key` and make sure they have
+ correct permissions:
+
+ ```bash
+ chmod 600 /etc/gitlab/ssl/registry.gitlab.example.com.*
+ ```
+
+1. Once the TLS certificate is in place, edit `/etc/gitlab/gitlab.rb` with:
+
+ ```ruby
+ registry_external_url 'https://registry.gitlab.example.com'
+ ```
+
+ Note how the `registry_external_url` is listening on HTTPS.
+
+1. Save the file and [reconfigure GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure) for the changes to take effect.
+
+If you have a [wildcard certificate](https://en.wikipedia.org/wiki/Wildcard_certificate), you need to specify the path to the
+certificate in addition to the URL, in this case `/etc/gitlab/gitlab.rb` will
+look like:
+
+```ruby
+registry_nginx['ssl_certificate'] = "/etc/gitlab/ssl/certificate.pem"
+registry_nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/certificate.key"
+```
+
+**Installations from source**
+
+1. Open `/home/git/gitlab/config/gitlab.yml`, find the `registry` entry and
+ configure it with the following settings:
+
+ ```yaml
+ registry:
+ enabled: true
+ host: registry.gitlab.example.com
+ ```
+
+1. Save the file and [restart GitLab](../restart_gitlab.md#installations-from-source) for the changes to take effect.
+1. Make the relevant changes in NGINX as well (domain, port, TLS certificates path).
+
+Users should now be able to login to the Container Registry using their GitLab
+credentials:
+
+```bash
+docker login registry.gitlab.example.com
+```
+
+## Disable Container Registry site-wide
+
+NOTE: **Note:**
+Disabling the Registry in the Rails GitLab application as set by the following
+steps, will not remove any existing Docker images. This is handled by the
+Registry application itself.
+
+**Omnibus GitLab**
+
+1. Open `/etc/gitlab/gitlab.rb` and set `registry['enable']` to `false`:
+
+ ```ruby
+ registry['enable'] = false
+ ```
+
+1. Save the file and [reconfigure GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure) for the changes to take effect.
+
+**Installations from source**
+
+1. Open `/home/git/gitlab/config/gitlab.yml`, find the `registry` entry and
+ set `enabled` to `false`:
+
+ ```yaml
+ registry:
+ enabled: false
+ ```
+
+1. Save the file and [restart GitLab](../restart_gitlab.md#installations-from-source) for the changes to take effect.
+
+## Disable Container Registry for new projects site-wide
+
+If the Container Registry is enabled, then it will be available on all new
+projects. To disable this function and let the owners of a project to enable
+the Container Registry by themselves, follow the steps below.
+
+**Omnibus GitLab installations**
+
+1. Edit `/etc/gitlab/gitlab.rb` and add the following line:
+
+ ```ruby
+ gitlab_rails['gitlab_default_projects_features_container_registry'] = false
+ ```
+
+1. Save the file and [reconfigure GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure) for the changes to take effect.
+
+**Installations from source**
+
+1. Open `/home/git/gitlab/config/gitlab.yml`, find the `default_projects_features`
+ entry and configure it so that `container_registry` is set to `false`:
+
+ ```yaml
+ ## Default project features settings
+ default_projects_features:
+ issues: true
+ merge_requests: true
+ wiki: true
+ snippets: false
+ builds: true
+ container_registry: false
+ ```
+
+1. Save the file and [restart GitLab](../restart_gitlab.md#installations-from-source) for the changes to take effect.
+
+## Container Registry storage path
+
+NOTE: **Note:**
+For configuring storage in the cloud instead of the filesystem, see the
+[storage driver configuration](#container-registry-storage-driver).
+
+If you want to store your images on the filesystem, you can change the storage
+path for the Container Registry, follow the steps below.
+
+This path is accessible to:
+
+- The user running the Container Registry daemon.
+- The user running GitLab.
+
+CAUTION: **Warning** You should confirm that all GitLab, Registry and web server users
+have access to this directory.
+
+**Omnibus GitLab installations**
+
+The default location where images are stored in Omnibus, is
+`/var/opt/gitlab/gitlab-rails/shared/registry`. To change it:
+
+1. Edit `/etc/gitlab/gitlab.rb`:
+
+ ```ruby
+ gitlab_rails['registry_path'] = "/path/to/registry/storage"
+ ```
+
+1. Save the file and [reconfigure GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure) for the changes to take effect.
+
+**Installations from source**
+
+The default location where images are stored in source installations, is
+`/home/git/gitlab/shared/registry`. To change it:
+
+1. Open `/home/git/gitlab/config/gitlab.yml`, find the `registry` entry and
+ change the `path` setting:
+
+ ```yaml
+ registry:
+ path: shared/registry
+ ```
+
+1. Save the file and [restart GitLab](../restart_gitlab.md#installations-from-source) for the changes to take effect.
+
+## Container Registry storage driver
+
+You can configure the Container Registry to use a different storage backend by
+configuring a different storage driver. By default the GitLab Container Registry
+is configured to use the filesystem driver, which makes use of [storage path](#container-registry-storage-path)
+configuration.
+
+NOTE: **Note:** Enabling a storage driver other than `filesystem` would mean
+that your Docker client needs to be able to access the storage backend directly.
+In that case, you must use an address that resolves and is accessible outside GitLab server.
+
+The different supported drivers are:
+
+| Driver | Description |
+|------------|-------------------------------------|
+| filesystem | Uses a path on the local filesystem |
+| azure | Microsoft Azure Blob Storage |
+| gcs | Google Cloud Storage |
+| s3 | Amazon Simple Storage Service. Be sure to configure your storage bucket with the correct [S3 Permission Scopes](https://docs.docker.com/registry/storage-drivers/s3/#s3-permission-scopes). |
+| swift | OpenStack Swift Object Storage |
+| oss | Aliyun OSS |
+
+Read more about the individual driver's config options in the
+[Docker Registry docs](https://docs.docker.com/registry/configuration/#storage).
+
+CAUTION: **Warning:** GitLab will not backup Docker images that are not stored on the
+filesystem. Remember to enable backups with your object storage provider if
+desired.
+
+NOTE: **Note:**
+`regionendpoint` is only required when configuring an S3 compatible service such as Minio. It takes a URL such as `http://127.0.0.1:9000`.
+
+**Omnibus GitLab installations**
+
+To configure the `s3` storage driver in Omnibus:
+
+1. Edit `/etc/gitlab/gitlab.rb`:
+
+ ```ruby
+ registry['storage'] = {
+ 's3' => {
+ 'accesskey' => 's3-access-key',
+ 'secretkey' => 's3-secret-key-for-access-key',
+ 'bucket' => 'your-s3-bucket',
+ 'region' => 'your-s3-region',
+ 'regionendpoint' => 'your-s3-regionendpoint'
+ }
+ }
+ ```
+
+1. Save the file and [reconfigure GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure) for the changes to take effect.
+
+**Installations from source**
+
+Configuring the storage driver is done in your registry config YML file created
+when you [deployed your docker registry](https://docs.docker.com/registry/deploying/).
+
+`s3` storage driver example:
+
+```yml
+storage:
+ s3:
+ accesskey: 'AKIAKIAKI'
+ secretkey: 'secret123'
+ bucket: 'gitlab-registry-bucket-AKIAKIAKI'
+ region: 'your-s3-region'
+ regionendpoint: 'your-s3-regionendpoint'
+ cache:
+ blobdescriptor: inmemory
+ delete:
+ enabled: true
+```
+
+## Change the registry's internal port
+
+NOTE: **Note:**
+This is not to be confused with the port that GitLab itself uses to expose
+the Registry to the world.
+
+The Registry server listens on localhost at port `5000` by default,
+which is the address for which the Registry server should accept connections.
+In the examples below we set the Registry's port to `5001`.
+
+**Omnibus GitLab**
+
+1. Open `/etc/gitlab/gitlab.rb` and set `registry['registry_http_addr']`:
+
+ ```ruby
+ registry['registry_http_addr'] = "localhost:5001"
+ ```
+
+1. Save the file and [reconfigure GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure) for the changes to take effect.
+
+**Installations from source**
+
+1. Open the configuration file of your Registry server and edit the
+ [`http:addr`](https://docs.docker.com/registry/configuration/#http) value:
+
+ ```yaml
+ http
+ addr: localhost:5001
+ ```
+
+1. Save the file and restart the Registry server.
+
+## Disable Container Registry per project
+
+If Registry is enabled in your GitLab instance, but you don't need it for your
+project, you can disable it from your project's settings. Read the user guide
+on how to achieve that.
+
+## Disable Container Registry but use GitLab as an auth endpoint
+
+**Omnibus GitLab**
+
+You can use GitLab as an auth endpoint and use a non-bundled Container Registry.
+
+1. Open `/etc/gitlab/gitlab.rb` and set necessary configurations:
+
+ ```ruby
+ gitlab_rails['registry_enabled'] = true
+ gitlab_rails['registry_host'] = "registry.gitlab.example.com"
+ gitlab_rails['registry_port'] = "5005"
+ gitlab_rails['registry_api_url'] = "http://localhost:5000"
+ gitlab_rails['registry_path'] = "/var/opt/gitlab/gitlab-rails/shared/registry"
+ gitlab_rails['registry_issuer'] = "omnibus-gitlab-issuer"
+ ```
+
+1. A certificate keypair is required for GitLab and the Container Registry to
+ communicate securely. By default Omnibus GitLab will generate one keypair,
+ which is saved to `/var/opt/gitlab/gitlab-rails/etc/gitlab-registry.key`.
+ When using a non-bundled Container Registry, you will need to supply a
+ custom certificate key. To do that, add the following to
+ `/etc/gitlab/gitlab.rb`
+
+ ```ruby
+ gitlab_rails['registry_key_path'] = "/custom/path/to/registry-key.key"
+ # registry['internal_key'] should contain the contents of the custom key
+ # file. Line breaks in the key file should be marked using `\n` character
+ # Example:
+ registry['internal_key'] = "---BEGIN RSA PRIVATE KEY---\nMIIEpQIBAA\n"
+ ```
+
+ NOTE: **Note:**
+ The file specified at `registry_key_path` gets populated with the
+ content specified by `internal_key`, each time reconfigure is executed. If
+ no file is specified, Omnibus GitLab will default it to
+ `/var/opt/gitlab/gitlab-rails/etc/gitlab-registry.key` and will populate
+ it.
+
+1. Save the file and [reconfigure GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure) for the changes to take effect.
+
+**Installations from source**
+
+1. Open `/home/git/gitlab/config/gitlab.yml`, and edit the configuration settings under `registry`:
+
+ ```yaml
+ ## Container Registry
+
+ registry:
+ enabled: true
+ host: "registry.gitlab.example.com"
+ port: "5005"
+ api_url: "http://localhost:5000"
+ path: /var/opt/gitlab/gitlab-rails/shared/registry
+ key: /var/opt/gitlab/gitlab-rails/certificate.key
+ issuer: omnibus-gitlab-issuer
+ ```
+
+1. Save the file and [restart GitLab](../restart_gitlab.md#installations-from-source) for the changes to take effect.
+
+## Storage limitations
+
+Currently, there is no storage limitation, which means a user can upload an
+infinite amount of Docker images with arbitrary sizes. This setting will be
+configurable in future releases.
+
+## Configure Container Registry notifications
+
+You can configure the Container Registry to send webhook notifications in
+response to events happening within the registry.
+
+Read more about the Container Registry notifications config options in the
+[Docker Registry notifications documentation](https://docs.docker.com/registry/notifications/).
+
+NOTE: **Note:**
+Multiple endpoints can be configured for the Container Registry.
+
+**Omnibus GitLab installations**
+
+To configure a notification endpoint in Omnibus:
+
+1. Edit `/etc/gitlab/gitlab.rb`:
+
+ ```ruby
+ registry['notifications'] = [
+ {
+ 'name' => 'test_endpoint',
+ 'url' => 'https://gitlab.example.com/notify',
+ 'timeout' => '500ms',
+ 'threshold' => 5,
+ 'backoff' => '1s',
+ 'headers' => {
+ "Authorization" => ["AUTHORIZATION_EXAMPLE_TOKEN"]
+ }
+ }
+ ]
+ ```
+
+1. Save the file and [reconfigure GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure) for the changes to take effect.
+
+**Installations from source**
+
+Configuring the notification endpoint is done in your registry config YML file created
+when you [deployed your docker registry](https://docs.docker.com/registry/deploying/).
+
+Example:
+
+```yaml
+notifications:
+ endpoints:
+ - name: alistener
+ disabled: false
+ url: https://my.listener.com/event
+ headers: <http.Header>
+ timeout: 500
+ threshold: 5
+ backoff: 1000
+```
+
+## Troubleshooting
+
+Before diving in to the following sections, here's some basic troubleshooting:
+
+1. Check to make sure that the system clock on your Docker client and GitLab server have
+ been synchronized (e.g. via NTP).
+
+1. If you are using an S3-backed Registry, double check that the IAM
+ permissions and the S3 credentials (including region) are correct. See [the
+ sample IAM policy](https://docs.docker.com/registry/storage-drivers/s3/)
+ for more details.
+
+1. Check the Registry logs (e.g. `/var/log/gitlab/registry/current`) and the GitLab production logs
+ for errors (e.g. `/var/log/gitlab/gitlab-rails/production.log`). You may be able to find clues
+ there.
+
+### Using self-signed certificates with Container Registry
+
+If you're using a self-signed certificate with your Container Registry, you
+might encounter issues during the CI jobs like the following:
+
+```
+Error response from daemon: Get registry.example.com/v1/users/: x509: certificate signed by unknown authority
+```
+
+The Docker daemon running the command expects a cert signed by a recognized CA,
+thus the error above.
+
+While GitLab doesn't support using self-signed certificates with Container
+Registry out of the box, it is possible to make it work by
+[instructing the docker-daemon to trust the self-signed certificates](https://docs.docker.com/registry/insecure/#use-self-signed-certificates),
+mounting the docker-daemon and setting `privileged = false` in the Runner's
+`config.toml`. Setting `privileged = true` takes precedence over the docker-daemon:
+
+```toml
+ [runners.docker]
+ image = "ruby:2.1"
+ privileged = false
+ volumes = ["/var/run/docker.sock:/var/run/docker.sock", "/cache"]
+```
+
+Additional information about this: [issue 18239](https://gitlab.com/gitlab-org/gitlab-ce/issues/18239).
+
+### AWS S3 with the GitLab registry error when pushing large images
+
+When using AWS S3 with the GitLab registry, an error may occur when pushing
+large images. Look in the Registry log for the following error:
+
+```
+level=error msg="response completed with error" err.code=unknown err.detail="unexpected EOF" err.message="unknown error"
+```
+
+To resolve the error specify a `chunksize` value in the Registry configuration.
+Start with a value between `25000000` (25MB) and `50000000` (50MB).
+
+**For Omnibus installations**
+
+1. Edit `/etc/gitlab/gitlab.rb`:
+
+ ```ruby
+ registry['storage'] = {
+ 's3' => {
+ 'accesskey' => 'AKIAKIAKI',
+ 'secretkey' => 'secret123',
+ 'bucket' => 'gitlab-registry-bucket-AKIAKIAKI',
+ 'chunksize' => 25000000
+ }
+ }
+ ```
+
+1. Save the file and [reconfigure GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure) for the changes to take effect.
+
+**For installations from source**
+
+1. Edit `config/gitlab.yml`:
+
+ ```yaml
+ storage:
+ s3:
+ accesskey: 'AKIAKIAKI'
+ secretkey: 'secret123'
+ bucket: 'gitlab-registry-bucket-AKIAKIAKI'
+ chunksize: 25000000
+ ```
+
+1. Save the file and [restart GitLab](../restart_gitlab.md#installations-from-source) for the changes to take effect.
+
+### Supporting older Docker clients
+
+As of GitLab 11.9, we began shipping version 2.7.1 of the Docker container registry, which disables the schema1 manifest by default. If you are still using older Docker clients (1.9 or older), you may experience an error pushing images. See [omnibus-4145](https://gitlab.com/gitlab-org/omnibus-gitlab/issues/4145) for more details.
+
+You can add a configuration option for backwards compatibility.
+
+**For Omnibus installations**
+
+1. Edit `/etc/gitlab/gitlab.rb`:
+
+ ```ruby
+ registry['compatibility_schema1_enabled'] = true
+ ```
+
+1. Save the file and [reconfigure GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure) for the changes to take effect.
+
+**For installations from source**
+
+1. Edit the YML configuration file you created when you [deployed the registry](https://docs.docker.com/registry/deploying/). Add the following snippet:
+
+ ```yaml
+ compatibility:
+ schema1:
+ enabled: true
+ ```
+
+1. Restart the registry for the changes to take affect.
+
+### Docker connection error
+
+A Docker connection error can occur when there are special characters in either the group,
+project or branch name. Special characters can include:
+
+- Leading underscore
+- Trailing hyphen/dash
+- Double hyphen/dash
+
+To get around this, you can [change the group path](../../user/group/index.md#changing-a-groups-path),
+[change the project path](../../user/project/settings/index.md#renaming-a-repository) or change the
+branch name. Another option is to create a [push rule](../../push_rules/push_rules.html) to prevent
+this at the instance level.
+
+### Image push errors
+
+When getting errors or "retrying" loops in an attempt to push an image but `docker login` works fine,
+there is likely an issue with the headers forwarded to the registry by NGINX. The default recommended
+NGINX configurations should handle this, but it might occur in custom setups where the SSL is
+offloaded to a third party reverse proxy.
+
+This problem was discussed in a [docker project issue](https://github.com/docker/distribution/issues/970)
+and a simple solution would be to enable relative URLs in the Registry.
+
+**For Omnibus installations**
+
+1. Edit `/etc/gitlab/gitlab.rb`:
+
+ ```ruby
+ registry['env'] = {
+ "REGISTRY_HTTP_RELATIVEURLS" => true
+ }
+ ```
+
+1. Save the file and [reconfigure GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure) for the changes to take effect.
+
+**For installations from source**
+
+1. Edit the YML configuration file you created when you [deployed the registry](https://docs.docker.com/registry/deploying/). Add the following snippet:
+
+ ```yaml
+ http:
+ relativeurls: true
+ ```
+
+1. Save the file and [restart GitLab](../restart_gitlab.md#installations-from-source) for the changes to take effect.
+
+### Enable the Registry debug server
+
+The optional debug server can be enabled by setting the registry debug address
+in your `gitlab.rb` configuration.
+
+```ruby
+registry['debug_addr'] = "localhost:5001"
+```
+
+After adding the setting, [reconfigure GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure) to apply the change.
+
+Use curl to request debug output from the debug server:
+
+```bash
+curl localhost:5001/debug/health
+curl localhost:5001/debug/vars
+```
+
+### Advanced Troubleshooting
+
+NOTE: **Note:**
+The following section is only recommended for experts.
+
+Sometimes it's not obvious what is wrong, and you may need to dive deeper into
+the communication between the Docker client and the Registry to find out
+what's wrong. We will use a concrete example in the past to illustrate how to
+diagnose a problem with the S3 setup.
+
+#### Unexpected 403 error during push
+
+A user attempted to enable an S3-backed Registry. The `docker login` step went
+fine. However, when pushing an image, the output showed:
+
+```text
+The push refers to a repository [s3-testing.myregistry.com:4567/root/docker-test/docker-image]
+dc5e59c14160: Pushing [==================================================>] 14.85 kB
+03c20c1a019a: Pushing [==================================================>] 2.048 kB
+a08f14ef632e: Pushing [==================================================>] 2.048 kB
+228950524c88: Pushing 2.048 kB
+6a8ecde4cc03: Pushing [==> ] 9.901 MB/205.7 MB
+5f70bf18a086: Pushing 1.024 kB
+737f40e80b7f: Waiting
+82b57dbc5385: Waiting
+19429b698a22: Waiting
+9436069b92a3: Waiting
+error parsing HTTP 403 response body: unexpected end of JSON input: ""
+```
+
+This error is ambiguous, as it's not clear whether the 403 is coming from the
+GitLab Rails application, the Docker Registry, or something else. In this
+case, since we know that since the login succeeded, we probably need to look
+at the communication between the client and the Registry.
+
+The REST API between the Docker client and Registry is [described
+here](https://docs.docker.com/registry/spec/api/). Normally, one would just
+use Wireshark or tcpdump to capture the traffic and see where things went
+wrong. However, since all communications between Docker clients and servers
+are done over HTTPS, it's a bit difficult to decrypt the traffic quickly even
+if you know the private key. What can we do instead?
+
+One way would be to disable HTTPS by setting up an [insecure
+Registry](https://docs.docker.com/registry/insecure/). This could introduce a
+security hole and is only recommended for local testing. If you have a
+production system and can't or don't want to do this, there is another way:
+use mitmproxy, which stands for Man-in-the-Middle Proxy.
+
+#### mitmproxy
+
+[mitmproxy](https://mitmproxy.org/) allows you to place a proxy between your
+client and server to inspect all traffic. One wrinkle is that your system
+needs to trust the mitmproxy SSL certificates for this to work.
+
+The following installation instructions assume you are running Ubuntu:
+
+1. [Install mitmproxy](https://docs.mitmproxy.org/stable/overview-installation/).
+1. Run `mitmproxy --port 9000` to generate its certificates.
+ Enter <kbd>CTRL</kbd>-<kbd>C</kbd> to quit.
+1. Install the certificate from `~/.mitmproxy` to your system:
+
+ ```sh
+ sudo cp ~/.mitmproxy/mitmproxy-ca-cert.pem /usr/local/share/ca-certificates/mitmproxy-ca-cert.crt
+ sudo update-ca-certificates
+ ```
+
+If successful, the output should indicate that a certificate was added:
+
+```sh
+Updating certificates in /etc/ssl/certs... 1 added, 0 removed; done.
+Running hooks in /etc/ca-certificates/update.d....done.
+```
+
+To verify that the certificates are properly installed, run:
+
+```sh
+mitmproxy --port 9000
+```
+
+This will run mitmproxy on port `9000`. In another window, run:
+
+```sh
+curl --proxy http://localhost:9000 https://httpbin.org/status/200
+```
+
+If everything is set up correctly, you will see information on the mitmproxy window and
+no errors from the curl commands.
+
+#### Running the Docker daemon with a proxy
+
+For Docker to connect through a proxy, you must start the Docker daemon with the
+proper environment variables. The easiest way is to shutdown Docker (e.g. `sudo initctl stop docker`)
+and then run Docker by hand. As root, run:
+
+```sh
+export HTTP_PROXY="http://localhost:9000"
+export HTTPS_PROXY="https://localhost:9000"
+docker daemon --debug
+```
+
+This will launch the Docker daemon and proxy all connections through mitmproxy.
+
+#### Running the Docker client
+
+Now that we have mitmproxy and Docker running, we can attempt to login and push
+a container image. You may need to run as root to do this. For example:
+
+```sh
+docker login s3-testing.myregistry.com:4567
+docker push s3-testing.myregistry.com:4567/root/docker-test/docker-image
+```
+
+In the example above, we see the following trace on the mitmproxy window:
+
+![mitmproxy output from Docker](img/mitmproxy-docker.png)
+
+The above image shows:
+
+- The initial PUT requests went through fine with a 201 status code.
+- The 201 redirected the client to the S3 bucket.
+- The HEAD request to the AWS bucket reported a 403 Unauthorized.
+
+What does this mean? This strongly suggests that the S3 user does not have the right
+[permissions to perform a HEAD request](http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectHEAD.html).
+The solution: check the [IAM permissions again](https://docs.docker.com/registry/storage-drivers/s3/).
+Once the right permissions were set, the error will go away.
diff --git a/doc/administration/packages/dependency_proxy.md b/doc/administration/packages/dependency_proxy.md
new file mode 100644
index 00000000000..967ba2592c3
--- /dev/null
+++ b/doc/administration/packages/dependency_proxy.md
@@ -0,0 +1,148 @@
+# GitLab Dependency Proxy administration **(PREMIUM ONLY)**
+
+> [Introduced](https://gitlab.com/gitlab-org/gitlab-ee/issues/7934) in [GitLab Premium](https://about.gitlab.com/pricing/) 11.11.
+
+GitLab can be utilized as a dependency proxy for a variety of common package managers.
+
+This is the administration documentation. If you want to learn how to use the
+dependency proxies, see the [user guide](../../user/group/dependency_proxy/index.md).
+
+## Enabling the Dependency Proxy feature
+
+NOTE: **Note:**
+Dependency proxy requires the Puma web server to be enabled.
+Puma support is EXPERIMENTAL at this time.
+
+To enable the Dependency proxy feature:
+
+**Omnibus GitLab installations**
+
+1. Edit `/etc/gitlab/gitlab.rb` and add the following line:
+
+ ```ruby
+ gitlab_rails['dependency_proxy_enabled'] = true
+ ```
+
+1. Save the file and [reconfigure GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure "How to reconfigure Omnibus GitLab") for the changes to take effect.
+1. Enable the [Puma web server](https://docs.gitlab.com/omnibus/settings/puma.html).
+
+**Installations from source**
+
+1. After the installation is complete, you will have to configure the `dependency_proxy`
+ section in `config/gitlab.yml`. Set to `true` to enable it:
+
+ ```yaml
+ dependency_proxy:
+ enabled: true
+ ```
+
+1. [Restart GitLab](../restart_gitlab.md#installations-from-source "How to restart GitLab") for the changes to take effect.
+1. Enable the [Puma web server](../../install/installation.md#using-puma).
+
+## Changing the storage path
+
+By default, the dependency proxy files are stored locally, but you can change the default
+local location or even use object storage.
+
+### Changing the local storage path
+
+The dependency proxy files for Omnibus GitLab installations are stored under
+`/var/opt/gitlab/gitlab-rails/shared/dependency_proxy/` and for source
+installations under `shared/dependency_proxy/` (relative to the Git home directory).
+To change the local storage path:
+
+**Omnibus GitLab installations**
+
+1. Edit `/etc/gitlab/gitlab.rb` and add the following line:
+
+ ```ruby
+ gitlab_rails['dependency_proxy_storage_path'] = "/mnt/dependency_proxy"
+ ```
+
+1. Save the file and [reconfigure GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure "How to reconfigure Omnibus GitLab") for the changes to take effect.
+
+**Installations from source**
+
+1. Edit the `dependency_proxy` section in `config/gitlab.yml`:
+
+ ```yaml
+ dependency_proxy:
+ enabled: true
+ storage_path: shared/dependency_proxy
+ ```
+
+1. [Restart GitLab](../restart_gitlab.md#installations-from-source "How to restart GitLab") for the changes to take effect.
+
+### Using object storage
+
+Instead of relying on the local storage, you can use an object storage to
+upload the blobs of the dependency proxy:
+
+**Omnibus GitLab installations**
+
+1. Edit `/etc/gitlab/gitlab.rb` and add the following lines (uncomment where
+ necessary):
+
+ ```ruby
+ gitlab_rails['dependency_proxy_enabled'] = true
+ gitlab_rails['dependency_proxy_storage_path'] = "/var/opt/gitlab/gitlab-rails/shared/dependency_proxy"
+ gitlab_rails['dependency_proxy_object_store_enabled'] = true
+ gitlab_rails['dependency_proxy_object_store_remote_directory'] = "dependency_proxy" # The bucket name.
+ gitlab_rails['dependency_proxy_object_store_direct_upload'] = false # Use Object Storage directly for uploads instead of background uploads if enabled (Default: false).
+ gitlab_rails['dependency_proxy_object_store_background_upload'] = true # Temporary option to limit automatic upload (Default: true).
+ gitlab_rails['dependency_proxy_object_store_proxy_download'] = false # Passthrough all downloads via GitLab instead of using Redirects to Object Storage.
+ gitlab_rails['dependency_proxy_object_store_connection'] = {
+ ##
+ ## If the provider is AWS S3, uncomment the following
+ ##
+ #'provider' => 'AWS',
+ #'region' => 'eu-west-1',
+ #'aws_access_key_id' => 'AWS_ACCESS_KEY_ID',
+ #'aws_secret_access_key' => 'AWS_SECRET_ACCESS_KEY',
+ ##
+ ## If the provider is other than AWS (an S3-compatible one), uncomment the following
+ ##
+ #'host' => 's3.amazonaws.com',
+ #'aws_signature_version' => 4 # For creation of signed URLs. Set to 2 if provider does not support v4.
+ #'endpoint' => 'https://s3.amazonaws.com' # Useful for S3-compliant services such as DigitalOcean Spaces.
+ #'path_style' => false # If true, use 'host/bucket_name/object' instead of 'bucket_name.host/object'.
+ }
+ ```
+
+1. Save the file and [reconfigure GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure "How to reconfigure Omnibus GitLab") for the changes to take effect.
+
+**Installations from source**
+
+1. Edit the `dependency_proxy` section in `config/gitlab.yml` (uncomment where necessary):
+
+ ```yaml
+ dependency_proxy:
+ enabled: true
+ ##
+ ## The location where build dependency_proxy are stored (default: shared/dependency_proxy).
+ ##
+ #storage_path: shared/dependency_proxy
+ object_store:
+ enabled: false
+ remote_directory: dependency_proxy # The bucket name.
+ #direct_upload: false # Use Object Storage directly for uploads instead of background uploads if enabled (Default: false).
+ #background_upload: true # Temporary option to limit automatic upload (Default: true).
+ #proxy_download: false # Passthrough all downloads via GitLab instead of using Redirects to Object Storage.
+ connection:
+ ##
+ ## If the provider is AWS S3, uncomment the following
+ ##
+ #provider: AWS
+ #region: us-east-1
+ #aws_access_key_id: AWS_ACCESS_KEY_ID
+ #aws_secret_access_key: AWS_SECRET_ACCESS_KEY
+ ##
+ ## If the provider is other than AWS (an S3-compatible one), uncomment the following
+ ##
+ #host: 's3.amazonaws.com' # default: s3.amazonaws.com.
+ #aws_signature_version: 4 # For creation of signed URLs. Set to 2 if provider does not support v4.
+ #endpoint: 'https://s3.amazonaws.com' # Useful for S3-compliant services such as DigitalOcean Spaces.
+ #path_style: false # If true, use 'host/bucket_name/object' instead of 'bucket_name.host/object'.
+ ```
+
+1. [Restart GitLab](../restart_gitlab.md#installations-from-source "How to restart GitLab") for the changes to take effect.
diff --git a/doc/administration/packages/img/mitmproxy-docker.png b/doc/administration/packages/img/mitmproxy-docker.png
new file mode 100644
index 00000000000..aa3b6a0b830
--- /dev/null
+++ b/doc/administration/packages/img/mitmproxy-docker.png
Binary files differ
diff --git a/doc/administration/packages/index.md b/doc/administration/packages/index.md
new file mode 100644
index 00000000000..99ec5811681
--- /dev/null
+++ b/doc/administration/packages/index.md
@@ -0,0 +1,175 @@
+# GitLab Package Registry administration **(PREMIUM ONLY)**
+
+GitLab Packages allows organizations to utilize GitLab as a private repository
+for a variety of common package managers. Users are able to build and publish
+packages, which can be easily consumed as a dependency in downstream projects.
+
+The Packages feature allows GitLab to act as a repository for the following:
+
+| Software repository | Description | Available in GitLab version |
+| ------------------- | ----------- | --------------------------- |
+| [Maven Repository](../../user/packages/maven_repository/index.md) | The GitLab Maven Repository enables every project in GitLab to have its own space to store [Maven](https://maven.apache.org/) packages. | 11.3+ |
+| [NPM Registry](../../user/packages/npm_registry/index.md) | The GitLab NPM Registry enables every project in GitLab to have its own space to store [NPM](https://www.npmjs.com/) packages. | 11.7+ |
+
+Don't you see your package management system supported yet?
+Please consider contributing
+to GitLab. This [development documentation](../../development/packages.md) will guide you through the process.
+
+## Enabling the Packages feature
+
+NOTE: **Note:**
+After the Packages feature is enabled, the repositories are available
+for all new projects by default. To enable it for existing projects, users will
+have to explicitly do so in the project's settings.
+
+To enable the Packages feature:
+
+**Omnibus GitLab installations**
+
+1. Edit `/etc/gitlab/gitlab.rb` and add the following line:
+
+ ```ruby
+ gitlab_rails['packages_enabled'] = true
+ ```
+
+1. Save the file and [reconfigure GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure "How to reconfigure Omnibus GitLab") for the changes to take effect.
+
+**Installations from source**
+
+1. After the installation is complete, you will have to configure the `packages`
+ section in `config/gitlab.yml`. Set to `true` to enable it:
+
+ ```yaml
+ packages:
+ enabled: true
+ ```
+
+1. [Restart GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure "How to reconfigure Omnibus GitLab") for the changes to take effect.
+
+## Changing the storage path
+
+By default, the packages are stored locally, but you can change the default
+local location or even use object storage.
+
+### Changing the local storage path
+
+The packages for Omnibus GitLab installations are stored under
+`/var/opt/gitlab/gitlab-rails/shared/packages/` and for source
+installations under `shared/packages/` (relative to the Git homedir).
+To change the local storage path:
+
+**Omnibus GitLab installations**
+
+1. Edit `/etc/gitlab/gitlab.rb` and add the following line:
+
+ ```ruby
+ gitlab_rails['packages_storage_path'] = "/mnt/packages"
+ ```
+
+1. Save the file and [reconfigure GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure)
+ for the changes to take effect.
+
+**Installations from source**
+
+1. Edit the `packages` section in `config/gitlab.yml`:
+
+ ```yaml
+ packages:
+ enabled: true
+ storage_path: shared/packages
+ ```
+
+1. Save the file and [restart GitLab](../restart_gitlab.md#installations-from-source) for the changes to take effect.
+
+### Using object storage
+
+Instead of relying on the local storage, you can use an object storage to
+upload packages:
+
+**Omnibus GitLab installations**
+
+1. Edit `/etc/gitlab/gitlab.rb` and add the following lines (uncomment where
+ necessary):
+
+ ```ruby
+ gitlab_rails['packages_enabled'] = true
+ gitlab_rails['packages_storage_path'] = "/var/opt/gitlab/gitlab-rails/shared/packages"
+ gitlab_rails['packages_object_store_enabled'] = true
+ gitlab_rails['packages_object_store_remote_directory'] = "packages" # The bucket name.
+ gitlab_rails['packages_object_store_direct_upload'] = false # Use Object Storage directly for uploads instead of background uploads if enabled (Default: false).
+ gitlab_rails['packages_object_store_background_upload'] = true # Temporary option to limit automatic upload (Default: true).
+ gitlab_rails['packages_object_store_proxy_download'] = false # Passthrough all downloads via GitLab instead of using Redirects to Object Storage.
+ gitlab_rails['packages_object_store_connection'] = {
+ ##
+ ## If the provider is AWS S3, uncomment the following
+ ##
+ #'provider' => 'AWS',
+ #'region' => 'eu-west-1',
+ #'aws_access_key_id' => 'AWS_ACCESS_KEY_ID',
+ #'aws_secret_access_key' => 'AWS_SECRET_ACCESS_KEY',
+ ##
+ ## If the provider is other than AWS (an S3-compatible one), uncomment the following
+ ##
+ #'host' => 's3.amazonaws.com',
+ #'aws_signature_version' => 4 # For creation of signed URLs. Set to 2 if provider does not support v4.
+ #'endpoint' => 'https://s3.amazonaws.com' # Useful for S3-compliant services such as DigitalOcean Spaces.
+ #'path_style' => false # If true, use 'host/bucket_name/object' instead of 'bucket_name.host/object'.
+ }
+ ```
+
+1. Save the file and [reconfigure GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure)
+ for the changes to take effect.
+
+**Installations from source**
+
+1. Edit the `packages` section in `config/gitlab.yml` (uncomment where necessary):
+
+ ```yaml
+ packages:
+ enabled: true
+ ##
+ ## The location where build packages are stored (default: shared/packages).
+ ##
+ #storage_path: shared/packages
+ object_store:
+ enabled: false
+ remote_directory: packages # The bucket name.
+ #direct_upload: false # Use Object Storage directly for uploads instead of background uploads if enabled (Default: false).
+ #background_upload: true # Temporary option to limit automatic upload (Default: true).
+ #proxy_download: false # Passthrough all downloads via GitLab instead of using Redirects to Object Storage.
+ connection:
+ ##
+ ## If the provider is AWS S3, uncomment the following
+ ##
+ #provider: AWS
+ #region: us-east-1
+ #aws_access_key_id: AWS_ACCESS_KEY_ID
+ #aws_secret_access_key: AWS_SECRET_ACCESS_KEY
+ ##
+ ## If the provider is other than AWS (an S3-compatible one), uncomment the following
+ ##
+ #host: 's3.amazonaws.com' # default: s3.amazonaws.com.
+ #aws_signature_version: 4 # For creation of signed URLs. Set to 2 if provider does not support v4.
+ #endpoint: 'https://s3.amazonaws.com' # Useful for S3-compliant services such as DigitalOcean Spaces.
+ #path_style: false # If true, use 'host/bucket_name/object' instead of 'bucket_name.host/object'.
+ ```
+
+1. Save the file and [restart GitLab](../restart_gitlab.md#installations-from-source) for the changes to take effect.
+
+### Migrating local packages to object storage
+
+After [configuring the object storage](#using-object-storage), you may use the
+following task to migrate existing packages from the local storage to the remote one.
+The processing will be done in a background worker and requires **no downtime**.
+
+For Omnibus GitLab:
+
+```sh
+sudo gitlab-rake "gitlab:packages:migrate"
+```
+
+For installations from source:
+
+```bash
+RAILS_ENV=production sudo -u git -H bundle exec rake gitlab:packages:migrate
+```