4
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

GitLab on Dockerの日本語化

4
Last updated at Posted at 2017-05-06

はじめに

以下の記事をベースに、Docker上のGitLab(9.1.1)の日本語化を行ったので、その内容を書き記します。

CentOS7に構築したGitLab8を日本語化

GitLab on Dockerインストール

GitLab on Dockerについては、sameersbn/docker-gitlabのdocker-compose.ymlを使って、docker-composeでコンテナを起動します。
一部、docker-compose.ymlを書き換えて、GitLab:9.1.1のイメージをダウンロードするように修正します。これは2017年5月6日時点で、日本語化パッチがGitLab9.1.1までしか対応していないためです。

$ diff docker-compose.yml docker-compose.yml.org

25c25
<     image: sameersbn/gitlab:9.1.1
---
>     image: sameersbn/gitlab:9.1.2

また、volumesの内容は、それぞれの環境によって変更してください。私はMacOSで実行したので、以下のように変更しました。

$ diff docker-compose.yml docker-compose.yml.org

10c10
<     - /Users/Shared/redis:/var/lib/redis:Z
---
>     - /srv/docker/gitlab/redis:/var/lib/redis:Z
16c16
<     - /Users/Shared/postgresql:/var/lib/postgresql:Z
---
>     - /srv/docker/gitlab/postgresql:/var/lib/postgresql:Z
33c33
<     - /Users/Shared/gitlab:/home/git/data:Z
---
>     - /srv/docker/gitlab/gitlab:/home/git/data:Z

docker-compose.ymlの修正が終わったら、docker-composeでコンテナを起動します。

$ docker-compose up

日本語化

docker-composeで起動したら、docker_gitlab_1にdocker execでアクセスして、日本語化パッチを適用します。
日本語化については、ksoichiro/gitlab-i18n-patchを利用しています。

$ docker exec -it docker_gitlab_1 /bin/bash
# apt update 
# apt install patch
# cd /usr/local/src/
# git clone https://github.com/ksoichiro/gitlab-i18n-patch.git
# cd /home/git/gitlab
# patch -p1 < /usr/local/src/gitlab-i18n-patch/patches/v9.1.1/app_ja.patch

日本語化パッチ適用後に、プリコンパイルし直す。

# cd /home/git/gitlab
# rm -rf public/assets
# export PATH=/home/git/gitlab/bin:$PATH
# bundle exec rake assets:precompile RAILS_ENV=production
# rake webpack:compile

プリコンパイルが終わったら、dockerイメージからexitして、コンテナの再起動をします。
再起動は必須ではないですが、後々再起動した時にエラーが出ると面倒なので、動作確認のため再起動します。

$ docker-compose stop
$ docker-compose start 

その後、Webブラウザからhttp://localhost:10080/にアクセスすると、
日本語化したGitLabが使えるようになります。

4
8
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
4
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?