【gitlab】--安装部署

文章目录

docker创建

1.yaml文件

官网参考:https://docs.gitlab.com/install/docker/installation/

中文版本:https://gitlab.cn/docs/jh/install/docker/installation/#create-a-directory-for-the-volumes

镜像选择:

yaml 复制代码
services:
  gitlab:
    image: gitlab/gitlab-ce:18.1.4-ce.0
    container_name: gitlab-ce-18.1.4
    restart: always
    hostname: '10.168.1.106'
    environment:
      GITLAB_OMNIBUS_CONFIG: |
        # Add any other gitlab.rb configuration here, each on its own line
        external_url 'http://10.168.1.106:8088'
        gitlab_rails['gitlab_shell_ssh_port'] = 222
    ports:
      - '8088:8088'
      - '44344:443'
      - '222:22'
    volumes:
      - './config:/etc/gitlab'
      - './logs:/var/log/gitlab'
      - './data:/var/opt/gitlab'
    shm_size: '256m'

检查:

bash 复制代码
# 检查GitLab服务是否全部正常运行
docker exec gitlab-ce-18.1.4 gitlab-ctl status

# 检查配置文件
cat /etc/gitlab/gitlab.rb | grep -E "external_url|gitlab_shell_ssh_port"

2.初始密码

初始密码位置:

gitlab/config/initial_root_password

3.设置中文


4.禁用新注册

4.修改root账户密码

进入容器
bash 复制代码
docker exec -it gitlab /bin/bash
进入控制台
bash 复制代码
gitlab-rails console
获取root用户
ruby 复制代码
user = User.where(id:1).first
修改密码
ruby 复制代码
user.password = 'YourNewPassword'
再次输入密码
ruby 复制代码
user.password_confirmation = 'YourNewPassword'
保存
ruby 复制代码
user.save!

5.gitlab.rb常用配置

ip端口配置

rb 复制代码
external_url 'http://10.168.1.106:8080'
bash 复制代码
# 修改完全后重新配置 GitLab

# 重新配置 GitLab
gitlab-ctl reconfigure

# 重启 GitLab
gitlab-ctl restart

# 清除缓存(如果需要)
gitlab-rake cache:clear
相关推荐
一念一花一世界2 天前
DevOps实战(12) - 使用Arbess+GitLab实现Java项目构建并将制品上传Aliyun OSS
阿里云·ci/cd·gitlab·devops·arbess
自己的九又四分之三站台2 天前
GitLab:定义、起源与发展历史
gitlab
bloglin999992 天前
gitlab内网配置https配置加载异常
网络协议·https·gitlab
TO_ZRG3 天前
Unity PackageManager
unity·gitlab
行走的陀螺仪3 天前
GitLab CI/CD 完整教学指南
前端·ci/cd·gitlab·团队开发·自动化测试部署
HIT_Weston3 天前
44、【Ubuntu】【Gitlab】拉出内网 Web 服务:http.server 分析(一)
前端·ubuntu·gitlab
一念一花一世界3 天前
DevOps实战(10) - 使用Arbess+GitLab+Hadess实现Java项目构建并上传制品
ci/cd·gitlab·devops·arbess
HIT_Weston3 天前
45、【Ubuntu】【Gitlab】拉出内网 Web 服务:http.server 分析(二)
前端·http·gitlab
询问QQ:276998854 天前
基于手肘法的kmeans聚类数在Matlab中的精确识别:风电与光伏功率分析
gitlab
HIT_Weston6 天前
43、【Ubuntu】【Gitlab】拉出内网 Web 服务:静态&动态服务
前端·ubuntu·gitlab