2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Dockerで構築したGitLabのアップグレード方法

Last updated at Posted at 2024-05-23

はじめに

Dockerコンテナで構築したGitLabのアップグレードを行う機会があり、実施したことをまとめます。

15.6.2から17.0.1にアップグレードします。

念のためバックアップ取得

gitlab という名前のコンテナが稼働しているとします。

docker exec -t gitlab gitlab-backup create
2024-04-04 01:17:08 +0000 -- Dumping main_database ... 
Dumping PostgreSQL database gitlabhq_production ... [DONE]
2024-04-04 01:17:18 +0000 -- Dumping main_database ... done
2024-04-04 01:17:18 +0000 -- Dumping ci_database ... [DISABLED]
2024-04-04 01:17:18 +0000 -- Dumping repositories ... 
・・・・
2024-04-04 01:17:22 +0000 -- Backup 1712193428_2024_04_04_15.6.2-ee is done.
2024-04-04 01:17:22 +0000 -- Deleting backup and restore lock file

コンテナ内の/var/opt/gitlab/backups/1712193428_2024_04_04_15.6.2-ee_gitlab_backup.tarにファイルが作成される。

アップグレードパスを確認

以下のサイトで、アップグレードパスを確認します。

今回は以下の順で更新を行います。

image.png

アップグレード手順

アップグレードパスに表示されているバージョンのイメージをダウンロードしておきます。

docker pull gitlab/gitlab-ee:15.11.13-ee.0
docker pull gitlab/gitlab-ee:16.1.6-ee.0
docker pull gitlab/gitlab-ee:16.3.7-ee.0
docker pull gitlab/gitlab-ee:16.7.7-ee.0
docker pull gitlab/gitlab-ee:16.11.3-ee.0
docker pull gitlab/gitlab-ee:17.0.1-ee.0

次に、稼働中のGitLabコンテナをダウンさせ、compose.yaml のイメージタグ名を15.11.13-ee.0に書き換えて、コンテナをupする。

処理が走るので、ログを確認しながら落ち着くのを待つ。

これを、15.11.13-ee.0 --> 16.1.6-ee.0 --> 16.3.7-ee.0 --> 16.7.7-ee.0 --> 16.11.3-ee.0 --> 17.0.1-ee.0 の順に繰り返す。

問題なくアップグレードされれば完了。

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?