Docker file and docker-compose for GitLab development

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Release notes

Lowers the barrier to entry for contributing code to GitLab. Contributors only need git and docker-compose in order to get started with an isolated environment that contains all development dependencies.

Problem to solve

As a GitLab user, I am missing a feature (specifically #18638). I decided I would try implementing it myself. I found the barrier to entry very high; while the gitlab-development-kit makes it easier to install all of the dependencies, it is still unattractive to use as-is because it does not isolate GitLab's dependencies from the developer's global environment. It simply dumps its specific versions of ruby, postgres, redis, golang, node.js etcetera into the host OS. For me personally, this was a no-go; I already have different versions of several of those packages installed for different reasons, and my casual contribution to GitLab is not important enough to justify dealing with the conflicts. I can only contribute to GitLab, if GitLab's dependencies are contained in an environment that is isolated from the rest of my system.

Proposal

I am proposing to add a Dockerfile-dev and docker-compose-dev.yml to the root directory of the GitLab project. The Dockerfile-dev is based on buildpack-deps and consists of an isolated installation of the gitlab-development-kit, including all dependencies for GitLab development and gitlab-development-kit itself. The docker-compose-dev.yml bind-mounts the user's local clone of GitLab into this image, in the location where gdk install will normally clone GitLab. This enables the following simple workflow for contributing to GitLab:

  1. Clone GitLab to local disk.
  2. Run docker-compose -f docker-compose-dev.yml up from the project root.
  3. Use editor and git in the host OS, while using gdk and other development tools in the container. The running GitLab instance can be visited in a browser of the host OS.

From the perspective of the container and gdk, everything is exacty set up as if the user had run gdk install directly on the host OS.

Note: I already started implementing this. Please add the "Accepting merge requests" label if possible.

Intended users

This proposal is potentially useful for anyone who wants to contribute code to GitLab. It is primarily intended for casual, infrequent contributors, but it may appeal to core contributors as well.

Metrics

If this feature is going to be as helpful as I think it will be, then new contributors will step in who would not consider contributing to GitLab before.

Edited by 🤖 GitLab Bot 🤖