2 种方式查找极狐GitLab 容器镜像 Tag,几分钟快速构建私有化部署实例

目录

通过 Helm 命令查找

第1步:添加 Helm Chart

第2步:更新 Helm Chart

第3步:Helm search 查找过往 tag

通过 Omnibus package 来查


极狐GitLab 是一个一体化 DevOps 平台,其灵活的私有化部署方式(源代码安装、Omnibus、容器镜像等)满足用户在不同场景下的私有化部署需求。比如在云原生时代用容器镜像进行极狐GitLab 实例的安装部署。极狐GitLab docker 安装官网文档中写道,使用如下命令,即可使用 registry.gitlab.cn/omnibus/gitlab-jh:latest 容器镜像,以容器化方式安装一个最新版的极狐GitLab 实例。

sudo docker run --detach \
  --hostname gitlab.example.com \
  --publish 443:443 --publish 80:80 --publish 22: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 \
  registry.gitlab.cn/omnibus/gitlab-jh:latest

此处的 latest tag 会随着极狐GitLab 版本的迭代而进行更新,比如目前最新的版本是 16.1,则 latest 就是 16.1.2,当极狐GitLab 发布 16.2 版本,则 latest 就会变为 16.2.x。

有些用户在安装时,可能倾向于找“老”一点的版本,这时候只需要找到对应的版本 tag 再安装即可。下面是查找过往镜像 tag 的两种方式:

通过 Helm 命令查找


可使用 Helm Chart 完成极狐GitLab 在 Kubernetes 上的安装。因此,可以很方便的借助 Helm Chart 来找想要的镜像 tag。

第1步:添加 Helm Chart

$ helm repo add gitlab-jh https://charts.gitlab.cn

第2步:更新 Helm Chart

$ helm repo update

这一步是为了确保 Helm Chart 包含了过往所有的 Chart 信息。

第3步:Helm search 查找过往 tag

$ helm search repo gitlab-jh -l
NAME                           CHART VERSION        APP VERSION        DESCRIPTION
gitlab-jh/gitlab               7.1.2                v16.1.2            The One DevOps Platform
gitlab-jh/gitlab               7.1.1                v16.1.1            The One DevOps Platform
gitlab-jh/gitlab               7.1.0                v16.1.0            The One DevOps Platform
gitlab-jh/gitlab               7.0.7                v16.0.7            The One DevOps Platform
gitlab-jh/gitlab               7.0.6                v16.0.6            The One DevOps Platform
gitlab-jh/gitlab               7.0.5                v16.0.5            The One DevOps Platform
gitlab-jh/gitlab               7.0.4                v16.0.4            The One DevOps Platform
gitlab-jh/gitlab               7.0.3                v16.0.3            The One DevOps Platform
gitlab-jh/gitlab               7.0.2                v16.0.2            The One DevOps Platform
gitlab-jh/gitlab               7.0.1                v16.0.1            The One DevOps Platform
gitlab-jh/gitlab               7.0.0                v16.0.0            The One DevOps Platform
gitlab-jh/gitlab               6.11.11              v15.11.11          The One DevOps Platform
.......太长,为了展示方便,删除一部分......
gitlab-jh/gitlab               5.7.2                14.7.2             Web-based Git-repository manager with wiki and ...
gitlab-jh/gitlab               5.7.1                14.7.1             Web-based Git-repository manager with wiki and ...
gitlab-jh/gitlab               5.7.0                14.7.0             Web-based Git-repository manager with wiki and ...
gitlab-jh/gitlab               5.6.7                14.6.7             Web-based Git-repository manager with wiki and ...
gitlab-jh/gitlab               5.6.6                14.6.6             Web-based Git-repository manager with wiki and ...
gitlab-jh/gitlab               5.6.5                14.6.5             Web-based Git-repository manager with wiki and ...
gitlab-jh/gitlab               5.6.4                14.6.4             Web-based Git-repository manager with wiki and ...
gitlab-jh/gitlab               5.6.3                14.6.3             Web-based Git-repository manager with wiki and ...
gitlab-jh/gitlab               5.6.2                14.6.2             Web-based Git-repository manager with wiki and ...
gitlab-jh/gitlab-runner        0.52.0               15.11.0            GitLab Runner
gitlab-jh/gitlab-runner        0.51.1               15.10.1            GitLab Runner
.......太长,为了展示方便,删除一部分......
gitlab-jh/gitlab-runner        0.40.1               14.10.1            GitLab Runner
gitlab-jh/gitlab-runner        0.40.0               14.10.0            GitLab Runner
gitlab-jh/gitlab-runner        0.39.0               14.9.0             GitLab Runner

可以看到上述命令列取出了极狐GitLab Helm Chart 中的所有版本的 Chart 信息(包括 Runner),其中就有 VERSION 信息,而这和镜像 tag 一一对应。

比如最新的版本是 16.1.2,则可以直接使用镜像 registry.gitlab.cn/omnibus/gitlab-jh:16.1.2 进行部署;如果要安装 15.11.11 版本的,则可以直接使用镜像 registry.gitlab.cn/omnibus/gitlab-jh:15.11.11 进行安装:

$ docker pull registry.gitlab.cn/omnibus/gitlab-jh:15.11.11
15.11.11: Pulling from omnibus/gitlab-jh
0fb668748fc8: Pull complete
63b19ec223eb: Extracting [===============================================>   ]  17.69MB/18.61MB
82caa32db81b: Download complete
a42b48e5b9ee: Download complete
bb717efa1826: Download complete
d68c100c7d22: Download complete
da0f831ccf8e: Download complete
b97dd97bb287: Downloading [>                                                  ]  17.28MB/1.447GB

其他版本均如此,将版本号当作 tag 安装即可。

通过 Omnibus package 来查找


极狐GitLab 的 Omnibus 安装包都可以在极狐GitLab 安装包管理网站上找到。

图片

将安装包的 Version 当作镜像 tag 即可。比如找到 15.10.1 版本,则安装的镜像为 registry.gitlab.cn/omnibus/gitlab-jh:15.10.1

$ docker pull registry.gitlab.cn/omnibus/gitlab-jh:15.10.1
15.10.1: Pulling from omnibus/gitlab-jh
5544ebdc0c7b: Pull complete
9c6f629a292d: Pull complete
b9963ff89e08: Extracting [==================================================>]  438.4kB/438.4kB
6b013a05fed1: Download complete
5beabc48233d: Download complete
cb4ddb72b13e: Download complete
1bf0aeca3430: Download complete
903a173540da: Downloading [=>                                                 ]  44.82MB/1.419GB

找到对应的镜像后就可以使用开头给出的指导文档和安装命令来在数分钟内快速构建起一个私有化部署的极狐GitLab 实例。

猜你喜欢

转载自blog.csdn.net/weixin_44749269/article/details/131878913
今日推荐