版本

极狐 GitLab v16.1.2-jh

步骤

如果使用 Let's Encrpt 集成,容器镜像仓库功能自动开启,访问地址为 your-gitlab-domain:5050
否则,默认不开启,需要自己配置开启:

  1. 选择已有 Gitlab 域名或者另外一个域名,修改 /etc/gitlab/gitlab.rb
  2. 把域名证书放在指定目录
  3. 重新配置 Gitlab 实例

参考:GitLab Container Registry administration

注意事项

  • 容器镜像仓库需要走 HTTPS 协议。因此,自定义域名需要自签证书
  • 自定义域名需要绑 hosts 才能以 CLI 方式访问容器镜像仓库
[root@localhost opt]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
127.0.0.1 gitlab.example.com
127.0.0.1 registry.gitlab.example.com

访问

Web UI

左侧菜单点击部署 -> 容器镜像库

CLI
[root@localhost opt]# docker login registry.gitlab.example.com
Username: your gitlab username
Password: your gitlab password
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded
[root@localhost opt]# docker logout registry.gitlab.example.com
Removing login credentials for registry.gitlab.example.com
posted on   心向所想  阅读(8)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek “源神”启动!「GitHub 热点速览」
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· 我与微信审核的“相爱相杀”看个人小程序副业
· C# 集成 DeepSeek 模型实现 AI 私有化(本地部署与 API 调用教程)
· spring官宣接入deepseek,真的太香了~

< 2025年2月 >
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 1
2 3 4 5 6 7 8
点击右上角即可分享
微信分享提示