Libiticum.nl

Commandline, docker, gitlab, opnsense

Use OPNsense as reverse proxy to gitlab on docker part 1

sander

Running gitlab-ce on docker is nowadays pretty easy. One needs to meet the following requirements to run gitlab in docker.

To start a gitlab-ce docker container create a docker-compose file with below contents:

web:
  image: 'gitlab/gitlab-ce:latest'
  container_name: 'gitlab-ce'
  restart: always
  hostname: 'git.some.lan'
  environment:
    GITLAB_OMNIBUS_CONFIG: |
      external_url 'https://git.some.lan'
      gitlab_rails['gitlab_shell_ssh_port'] = 2200
      # Add any other gitlab.rb configuration here, each on its own line
  ports:
    - '8000:80'
    - '4000:443'
    - '2200:22'
  volumes:
    - '<your gitlab config location>:/etc/gitlab'
    - '<your gitlab log location>:/var/log/gitlab'
    - 'your gitlab data location:/var/opt/gitlab'

Wait for some minutes, then your gitlab instance should be available at https://git.some.lan:4000

One can reset the root password for git with the following steps:

exec into the docker container:
docker exec -it gitlab-ce /bin/bash

Once inside the container issue the command:
gitlab-rake "gitlab:password:reset"

It will ask for username(root) and pass 
Back to top