You can run a docker registry either inside GitLab or use your own external docker registry together with GitLab where GitLab is only responsible to authenticate access to your registry.
I will describe in this article how to integrate an external registry with GitLab. The major problem that you encounter when choosing this setup is that there is no single description how to do this.
I had my projects hosted on GitHub and wanted to move this projects to my own instance. So after installing GitLab on my own server I started moving the projects.
Moving a project from GitHub to GitLab is quite easy. When creating a project in GitLab you have the chance to import a project from different sources. One of this sources is GitHub. For this the GitLab instance has to be configured to allow imports from GitHub (under Administration/Settings/Visibility and access controls).
I want to use the integrated CI/CD feature of GitLab so I have to install gitlab-runner as described in the documentation.
The installation does not need to be on the same host as GitLab — it is recommended not to do so.
After installing the gitlab-runner I register a runner with GitLab in order to use it.
After installing GitLab the next step is to configure NGINX as reverse proxy.
I add a reverse proxy because the NGINX server already runs for different services and I want to bundle all my services into a single web server.
Additionally this configuration gives me the possibility to use HTTP/2.