Docker方式安裝gitlab--ARM64平臺安裝詳解
一、部署前提條件
機器配置要大于4g,否則很容易啟動不了,報502
二、詳細操作
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:latest
2.4 進入容器修改配置文件
讓項目克隆地址顯示為宿主機的ip和port
vi /etc/gitlab/gitlab.rb external_url 'http://172.16.0.55' #gitlab訪問地址,可以寫域名。如果端口不寫的話默認為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地址應該是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
#重啟服務
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)文章
基于jib-maven-plugin插件快速構(gòu)建微服務docker鏡像的方法
這篇文章主要介紹了基于jib-maven-plugin快速構(gòu)建微服務docker鏡像的方法,對于?Java?程序來說使用?jib-maven-plugin?插件來構(gòu)建鏡像還是非常方便的,本文通過實例代碼詳細講解,需要的朋友可以參考下2023-02-02Centos7安裝Docker(2020最新親測可用,直接復制粘貼即可)
這篇文章主要介紹了Centos7安裝Docker(2020最新親測可用,直接復制粘貼即可),文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧2021-01-01