gitlab之container register

使用runner对代码进行容器打包。gitlab可以配置container registrey做仓库,考虑到已经使用vmvare harbor建立了docker 仓库,通过配置使用外置仓库。
vi /etc/gitlab/gitlab.rb

################################################################################
## Container Registry settings
##! Docs: https://docs.gitlab.com/ce/administration/container_registry.html
################################################################################

# registry_external_url 'https://registry.gitlab.example.com'

### Settings used by GitLab application
gitlab_rails['registry_enabled'] = true
# gitlab_rails['registry_host'] = "192.168.100.18"
# gitlab_rails['registry_port'] = "80"
gitlab_rails['registry_path'] = "/var/opt/gitlab/gitlab-rails/shared/registry"

#gitlab_rails['registry_path'] = "/library"

###! **Do not change the following 3 settings unless you know what you are
###!   doing**
gitlab_rails['registry_api_url'] = "http://192.168.100.18:80"
# gitlab_rails['registry_key_path'] = "/var/opt/gitlab/gitlab-rails/certificate.key"
# gitlab_rails['registry_issuer'] = "omnibus-gitlab-issuer for pzl"
### Settings used by Registry application
registry['enable'] = false

gitlab reconfigure重新配置发布gitlab

到底是api还是host,等下一步验证。

现在能在admin区看见container registry服务已经启动
虽然使用外置仓库没配置使用证书,但是还是要用open ssl生成一个证书放到配置中的目录,否则会报错。

推荐阅读更多精彩内容