★★★ Twitterやってます。フォローして頂けると嬉しいです(*^^*) ★★★
この記事にはプロモーションが含まれていることがあります

Docker版GitLabのバージョンを確認する方法

IT
スポンサーリンク

Docker版GitLabのバージョンを確認する方法

Dockerコンテナ版じゃない方は、目次1.2のGitLabのバージョン確認だけ実施すればよいと思います(たぶん)

GitLabのコンテナにアクセス

GitLabコンテナを特定する

Dockerコンテナにアクセスするには、コンテナ名かコンテナIDが必要です。
docker ps で現在動作しているDockerコンテナを表示します。

$ docker ps
CONTAINER ID  IMAGE                          COMMAND             CREATED             STATUS                    PORTS                                                NAMES
eb3309441cfc  gitlab/gitlab-ce:12.1.6-ce.0   "/assets/wrapper"   13 days ago         Up 40 minutes (healthy)   0.0.0.0:80->80/tcp, 443/tcp, 0.0.0.0:12022->22/tcp   gitlab01
$

先頭のIDまたは最後のNAMESのどちらかでアクセスできます。

GitLabコンテナにアクセスする

コンテナ名を付けていない人もいるかも知れないので、今回はコンテナIDで接続します。

$ docker exec -it eb3309441cfc /bin/bash
root@localhost:/#

root@localhost にプロンプトが変化しました。これでGitLabコンテナ内のBashを起動してコマンド受付状態になりました。

GitLabのバージョン確認

gitlab-rakeコマンドで情報を取得します。

root@localhost:/# gitlab-rake gitlab:env:info

少し時間がかかりますが、GitLabサーバの情報が返ってきます。
真ん中ぐらいにバージョンの記載があります。

GitLab information
Version: 12.1.6

root@localhost:/# gitlab-rake gitlab:env:info

System information
System:
Current User:   git
Using RVM:      no
Ruby Version:   2.6.3p62
Gem Version:    2.7.9
Bundler Version:1.17.3
Rake Version:   12.3.2
Redis Version:  3.2.12
Git Version:    2.21.0
Sidekiq Version:5.2.7
Go Version:     unknown

GitLab information
Version:        12.1.6
Revision:       4016bcac51d
Directory:      /opt/gitlab/embedded/service/gitlab-rails
DB Adapter:     PostgreSQL
DB Version:     10.7
URL:            http://local-gitlab
HTTP Clone URL: http://local-gitlab/some-group/some-project.git
SSH Clone URL:  git@local-gitlab:some-group/some-project.git
Using LDAP:     no
Using Omniauth: yes
Omniauth Providers:

GitLab Shell
Version:        9.3.0
Repository storage paths:
- default:      /var/opt/gitlab/git-data/repositories
GitLab Shell path:              /opt/gitlab/embedded/service/gitlab-shell
Git:            /opt/gitlab/embedded/bin/git
root@localhost:/#

GitLabコンテナとの接続を切断する

用事が済んだらexitでGitLabコンテナから出ましょう。間違えて変なコマンド打ち込んでGitLabが壊れたら洒落になりませんので… プロンプトが変化すれば切断完了です。

root@localhost:/# exit
exit
$

コメント

タイトルとURLをコピーしました