做論壇網(wǎng)站要辦理什么證件百度站長工具抓取診斷
下載鏡像
直接下載最新版,比較大有2.36G
docker pull gitlab/gitlab-ce
創(chuàng)建數(shù)據(jù)存放的目錄位置
按自己習(xí)慣位置創(chuàng)建目錄
mkdir -p /usr/local/docker/docker_gitlab
編寫docker-compose.yml
在上面創(chuàng)建的掛載目錄里面(/usr/local/docker/docker_gitlab)新建docker-compose.yml文件。
HTTP端口改成8888(根據(jù)自己習(xí)慣)
SSH端口改成2222(根據(jù)自己習(xí)慣)
version: '3.1'
services:gitlab:image: 'gitlab/gitlab-ce:latest'container_name: gitlabrestart: alwaysenvironment:GITLAB_OMNIBUS_CONFIG: |external_url 'http://192.168.170.111:8888'gitlab_rails['gitlab_shell_ssh_port'] = 2222ports:- '8888:8888'- '2222:2222'volumes:- './config:/etc/gitlab'- './logs:/var/log/gitlab'- './data:/var/opt/gitlab'
后臺運行容器組
docker-compose up -d
登錄Gitlab
訪問你部署的服務(wù)器IP+你設(shè)置的端口(192.168.170.111:8888)
如果訪問顯示502就是還沒啟動好,Gitlab比較吃配置,啟動較慢,可以通過查看日志命令觀察是否啟動好
docker logs -f gitlab
啟動好后首次登錄需要查看Gitlab初始密碼,默認(rèn)賬戶root
不用進(jìn)容器查看密碼,配置目錄掛載到了本地的/usr/local/docker/docker_gitlab/config目錄
直接在宿主機上查看即可,復(fù)制下面Password的密碼去登錄Gitlab
cat /usr/local/docker/docker_gitlab/config/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: nvTUWhHoL+6thfBh5y56j5uJHlgTvnCODrljfEW1pjs=# NOTE: This file will be automatically deleted in the first reconfigure run after 24 hours.
修改密碼
登錄后進(jìn)入賬戶設(shè)置里面設(shè)置個自定義密碼,最少8位數(shù)