Updating GitLab in a Docker Container

I have an instance of GitLab that I am using for a project that is suffering under an NDA.  I have it installed in a Docker container at home.  We have just bought some server space so I am migrating the service to the new server.  The GitLab I have at home is an older version than the latest.

It makes sense to update GitLab in place before doing the migration.  So, I need to back it up first before upgrading it and then migrating it to the new server.

A list:

  • I use a user to store docker-compose.yml’s
  • cd GitLab
  • docker-compose down
  • su root -c “tar cfj Backup/gitlab-20181213.tbz2 volumes/”
  • docker-compose up -d
  • docker commit -p gitlab_web_1 backup-gitlab-20181213
  • docker save -o Backup/docker-gitlab-20181213.tar backup-gitlab-20181213
  • docker exec -i -t gitlab_web_1 bash
  • gitlab-rake gitlab:backup:create STRATEGY=copy
  • exit
  • su root -c “cp volumes/data/backups/1544700734_2018_12_13_11.3.1_gitlab_backup.tar Backup/”
  • docker exec -i -t gitlab_web_1 bash

Strange, I have the same version of Ubuntu in the Docker container but ‘apt-get install gitlabce‘ won’t update to “gitlabce/xenial,now 11.5.3-ce.0″.  Let’s do this on both containers:

  • cd /tmp
  • curl -LO https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh
  • bach script.deb.sh
  • apt-get update
  • apt-get install gitlab-ce

That last one takes a LONG time but look:

I’m happy with that.  I’ve checked the site and everything seems to be working.  I did notice that the “apt-get install gitlabce” did a back up too.  Belt and braces though, Belt AND braces.

Leave a comment

Your e-mail address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.