Skip to content

GitLab and Docker

Deploying a Docker test environment

I use Docker Compose exclusively. I love Docker Compose:

Define and run multi-container applications with Docker

That's just what I want!

I have example configs in the bcarranza/configs project.

  • This simple setup is a single Omnibus and a single Runner with configs for LDAP, SMTP, et cetera.
  • This example starts to demonstrate how to do external Redis and external PostgreSQL.

  • Do we haave LDAP in the docs?

Using Docker locally

Given the wonder that is gitlabsandbox.cloud , I use Docker a bit differently these days. I now use Podman for much of what I used Docker for previously.

Common GitLab in Docker "gotchas"/pitfalls

Configuration

I do something like this:

start.sh

RUNNER_HOME=/srv/gitlab/runner GITLAB_HOME=/srv/gitlab docker-compose up -d

rebuild.sh

RUNNER_HOME=/srv/gitlab/runner GITLAB_HOME=/srv/gitlab docker-compose up  --build -d

You can set the hostname in docker-compose.yml and set up DNS in /etc/hosts or whatever.

Maintenance

One frustrating thing about using Docker Compose is having to deal with different versions of the compose file.

Another thing to keep in mind: don't edit /etc/gitlab/gitlab.rb manually! (The changes won't be preserved when the container is recreated. )

Miscellaneous

Docs: GitLab Docker images

We offer guidance on using Docker Engine, Compose or swarm mode.

Commands


  • In onboarding, tell people how to find gitlab.rb