Table of Contents

Back to MackTronIcs ...

1. Gitlab on Podman / With SSL

export GITLAB_HOME=/home/mack/sw/srv/gitlab

podman run --detach \
  --hostname git.lowsig.com \
  --publish 7443:443 --publish 7080:80 --publish 1922:22 \
  --name gitlab \
  --restart always \
  --volume $GITLAB_HOME/config:/etc/gitlab \
  --volume $GITLAB_HOME/logs:/var/log/gitlab \
  --volume $GITLAB_HOME/data:/var/opt/gitlab \
  --shm-size 256m \
  gitlab/gitlab-ce:latest

1.1. Common Operations for Gitlab in Container

  1. starting - run ./start-ce (need to rm it first, see step 3)
  2. stopping - run podman stop gitlab
  3. remove container each time - podman rm gitlab
  4. backup management
  5. creation of self signed certificate

    openssl genrsa -out server-key.pem 4096a
    openssl req -new -key server-key.pem -out server.csr
    openssl x509 -req -days 365 -in server.csr -signkey server-key.pem -out server-cert.pem
    mv server-cert.pem git.lowsig.com.crt
    mv server-key.pem  git.lowsig.com.key
    
  6. update config to use certificates
    • ensure letsencrypt is turned off
    • gitlab-ctl reconfigure

1.1.1. Backups

podman exec -it gitlab gitlab-backup create

Backups are in the SRV/gitlab/data/backups directory.

1.1.2. Upgrades

These are the steps I used successfully:

  1. perform backup
  2. podman stop gitlab
  3. podman rm gitlab
  4. re-pull the latest version and start it up as normal

    podman pull docker.io/gitlab/gitlab-ce:latest
    ./start-ce
    
  5. when it starts, it will upgrade itself in a few minutes

1.1.3. Shutting Down

It seems like when I do podman stop gitlab, gitlab takes too long and podman just kills it hard. So I'd suggest stopping it with a delay. I've created this script:

podman stop --time 60 gitlab

Author: Dan Mack

Created: 2023-03-13 Mon 13:50

Validate