arm64 UOS平台docker配置gitlab
- 加载或下载gitlab docker镜像
- 配置
加载或下载gitlab docker镜像
docker load < gitlab.tar
docker tag xxx gitlab_arm
配置
- 创建gitlab目录,在gitlab目录下创建etc log opt 目录
- 创建启动文件start_gitlab.sh并增加执行权限
docker run -itd \-p 9980:80 \-p 9922:22 \-v `pwd`/gitlab/etc:/etc/gitlab \-v `pwd`/gitlab/log:/var/log/gitlab \-v `pwd`/gitlab/opt:/var/opt/gitlab \--restart always \--privileged=true \--name gitlab \gitlab_arm
- 启动gitlab服务
./start_gitlab.sh
- gitlab服务配置
a. 进入容器:docker exec -it gitlab bash
b. 修改配置文件:vi /etc/gitlab/gitlab.rb
#ssh主机ip
gitlab_rails['gitlab_ssh_host'] = '192.168.1.6'
#ssh连接端口
gitlab_rails['gitlab_shell_ssh_port'] = 9922
#时区
gitlab_rails['time_zone'] = 'Asia/Shanghai'
#开启备份功能
gitlab_rails['manage_backup_path'] = true
#备份文件的权限
gitlab_rails['backup_archive_permissions'] = 0644
#保存备份 60 天
gitlab_rails['backup_keep_time'] = 5184000
c. 让配置生效:gitlab-ctl reconfigure
输入命令后,会执行一系列操作,直到最后出现:gitlab Reconfigured!
d. 修改gitlab.yml,默认为80端口,修改端口号为之前配置的端口9980
vi /opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml
e. 重启gitlab服务:gitlab-ctl restart
f. 查看管理员初始密码:
cat /etc/gitlab/initial_root_password
g. gitlab服务启动后以root用户登录并修改密码:
root Rlkk7iixHkuKQ6eUA3soQkU+1SlEkCEU9kAPl3taW8c=
之后可以创建用户及代码仓库…