Docker方式安裝gitlab--ARM64平臺安裝詳解
一、部署前提條件
機器配置要大于4g,否則很容易啟動不了,報502
二、詳細(xì)操作
2.1 拉取gitlab鏡像
gitlab-ce表示的是社區(qū)免費版本
docker pull yrzr/gitlab-ce-arm64v8:latest #arm64平臺
2.2 創(chuàng)建映射文件
mkdir -p /data/docker/gitlab/etc mkdir -p /data/docker/gitlab/log mkdir -p /data/docker/gitlab/data
2.3 啟動gitlab
#arm64平臺
sudo docker run \
--detach \
--restart always \
--name gitlab-ce \
--privileged=true \
--memory 4096M \
--publish 222:22 \
--publish 8088:80 \
--publish 4433:443 \
--env GITLAB_OMNIBUS_CONFIG=" \
nginx['redirect_http_to_https'] = true; "\
--volume /data/docker/gitlab/etc:/etc/gitlab:z \
--volume /data/docker/gitlab/log:/var/log/gitlab:z \
--volume /data/docker/gitlab/data:/var/opt/gitlab:z \
yrzr/gitlab-ce-arm64v8:latest2.4 進入容器修改配置文件
讓項目克隆地址顯示為宿主機的ip和port
vi /etc/gitlab/gitlab.rb external_url 'http://172.16.0.55' #gitlab訪問地址,可以寫域名。如果端口不寫的話默認(rèn)為80端口 gitlab_rails['gitlab_ssh_host'] = '172.16.0.55' #ssh主機ip gitlab_rails['gitlab_shell_ssh_port'] = 222 #ssh連接端口 #重新加載配置文件 gitlab-ctl reconfigure
注意不要重啟,/etc/gitlab/gitlab.rb文件的配置會映射到gitlab.yml這個文件,由于在docker中運行,在gitlab上生成的http地址應(yīng)該是http://172.16.0.55:8088,所以,要修改下面文件
vi /opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml #將端口號80修改為8088,讓項目克隆的http地址顯示正確
## GitLab settings
gitlab:
## Web server settings (note: host is the FQDN, do not include http://)
host: 172.16.0.55
port: 8088
https: false#重啟服務(wù)
gitlab-ctl restart
2.5 查看root登錄密碼
訪問 http://172.16.0.55:8088/users/sign_in
root@1eb2343359d2:/# cat /etc/gitlab/initial_root_password # WARNING: This value is valid only in the following conditions # 1. If provided manually (either via `GITLAB_ROOT_PASSWORD` environment variable or via `gitlab_rails['initial_root_password']` setting in `gitlab.rb`, it was provided before database was seeded for the first time (usually, the first reconfigure run). # 2. Password hasn't been changed manually, either via UI or via command line. # # If the password shown here doesn't work, you must reset the admin password following https://docs.gitlab.com/ee/security/reset_user_password.html#reset-your-root-password. Password: FZpGKk3WVhodQ4uhKrvVHEPbQ9SDVWFj+pRJcAMA0YI= # NOTE: This file will be automatically deleted in the first reconfigure run after 24 hours.
2.6 可選操作,修改root密碼
sudo docker exec -it gitlab-ce bash gitlab-rails console -e production user = User.where(id:1).first #查詢id為1的用戶,id為1的用戶是超級管理員 user.password='qwer4567' #修改密碼為qwer4567 user.save! #保存
2.7 登錄web并設(shè)置中文
preferences-->Localization--->language-->簡體中文
記錄時間:2023-10-09
總結(jié)
以上為個人經(jīng)驗,希望能給大家一個參考,也希望大家多多支持腳本之家。
相關(guān)文章
Docker安裝ClickHouse并初始化數(shù)據(jù)測試
clickhouse作為現(xiàn)在流行的數(shù)據(jù)分析數(shù)據(jù)庫,非常熱門,docker如何安裝ClickHouse,很多朋友并不是很明白,今天小編抽空給大家分享一篇教程關(guān)于Docker安裝ClickHouse并初始化數(shù)據(jù)測試的問題,一起看看吧2021-06-06
Docker 修改docker存儲位置 修改容器鏡像大小限制操作
這篇文章主要介紹了Docker 修改docker存儲位置 修改容器鏡像大小限制操作,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2020-11-11
用docker搭建selenium grid分布式環(huán)境實踐之路
這篇文章主要介紹了用docker搭建selenium grid分布式環(huán)境實踐之路,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2020-03-03
基于docker搭建redis-sentinel集群的方法示例
這篇文章主要介紹了基于docker搭建redis-sentinel集群的方法示例,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2019-06-06
Ubuntu22.04 LTS安裝docker以及docker-compose實踐
安裝Docker引擎需卸載舊版、更新apt、添加GPG密鑰、設(shè)置存儲庫并安裝,docker-compose通過GitHub下載,阿里云鏡像加速需在控制臺獲取加速地址并配置2025-08-08

