1.安装依赖
sudo apt-get update
sudo apt-get install -y curl openssh-server ca-certificates
sudo apt-get install -y postfix
#选择“Internet Site”并按Enter键,其他选择则默认
2.添加GitLab软件包存储库并安装软件包
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
3.安装gitlab-ce
sudo apt-get update
#以下操作2选1
#直接安装最新版本执行
sudo EXTERNAL_URL="http://你的ip" apt-get install gitlab-ce
#指定安装gitlab-ce的版本
sudo apt-cache madison gitlab-ce
sudo EXTERNAL_URL="http://你的ip" apt-get install gitlab-ce=11.0.4-ce.0
4.测试
浏览器访问你的ip 设置root账户的密码
5.配置https访问
#将ssl证书放入/etc/gitlab/ssl
sudo vim /etc/gitlab/gitlab.rb
external_url 'https://域名'
nginx['enable'] = true
nginx['redirect_http_to_https'] =true
nginx['ssl_certificate'] = "/etc/gitlab/ssl/域名的ssl证书.crt"
nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/域名的ssl证书.key"
#保存退出:wq
重启gitlab
sudo gitlab-ctl reconfigure
6.测试https
浏览器访问你的ip自动跳转https
7.配置GitLab容器注册管理
sudo vim /etc/gitlab/gitlab.rb
registry_external_url 'https://域名:4567'
#保存退出:wq
或
registry_nginx['enable'] = true
registry_nginx['ssl_certificate'] = "/etc/gitlab/ssl/*.crt"
registry_nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/*.key"
registry_external_url 'https://wjx-cloud.xyz'
### Settings used by GitLab application
gitlab_rails['registry_enabled'] = true
gitlab_rails['registry_host'] = "wjx-cloud.xyz"
gitlab_rails['registry_path'] = "/var/opt/gitlab/gitlab-rails/shared/registry"
sudo gitlab-ctl reconfigure
网友评论