Docker安装Gitlab

下载镜像

直接下载最新版,比较大有2.36G

docker pull gitlab/gitlab-ce

创建数据存放的目录位置

按自己习惯位置创建目录

mkdir -p /usr/local/docker/docker_gitlab

编写docker-compose.yml

在上面创建的挂载目录里面(/usr/local/docker/docker_gitlab)新建docker-compose.yml文件。

HTTP端口改成8888(根据自己习惯)

SSH端口改成2222(根据自己习惯)

version: '3.1'
services:
  gitlab:
    image: 'gitlab/gitlab-ce:latest'
    container_name: gitlab
    restart: always
    environment:
      GITLAB_OMNIBUS_CONFIG: |
        external_url 'http://192.168.170.111:8888'
        gitlab_rails['gitlab_shell_ssh_port'] = 2222
    ports:
      - '8888:8888'
      - '2222:2222'
    volumes:
      - './config:/etc/gitlab'
      - './logs:/var/log/gitlab'
      - './data:/var/opt/gitlab'

后台运行容器组

docker-compose up -d

登录Gitlab

访问你部署的服务器IP+你设置的端口(192.168.170.111:8888)

如果访问显示502就是还没启动好,Gitlab比较吃配置,启动较慢,可以通过查看日志命令观察是否启动好

docker logs -f gitlab

启动好后首次登录需要查看Gitlab初始密码,默认账户root

不用进容器查看密码,配置目录挂载到了本地的/usr/local/docker/docker_gitlab/config目录

直接在宿主机上查看即可,复制下面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.

修改密码

登录后进入账户设置里面设置个自定义密码,最少8位数

在这里插入图片描述

相关推荐

  1. docker-compose 安装gitlab

    2024-03-13 07:54:03       63 阅读
  2. docker安装gitlab-runner

    2024-03-13 07:54:03       49 阅读
  3. docker 安装gitlab

    2024-03-13 07:54:03       50 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-03-13 07:54:03       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-03-13 07:54:03       106 阅读
  3. 在Django里面运行非项目文件

    2024-03-13 07:54:03       87 阅读
  4. Python语言-面向对象

    2024-03-13 07:54:03       96 阅读

热门阅读

  1. LeetCode383 —赎金信

    2024-03-13 07:54:03       35 阅读
  2. Linux命令学习(一)history

    2024-03-13 07:54:03       38 阅读
  3. 【天池课堂】零基础入门数据挖掘-课程汇总

    2024-03-13 07:54:03       45 阅读
  4. webpack5高级--02_提升打包构建速度

    2024-03-13 07:54:03       36 阅读
  5. peft模型微调--Prompt Tuning

    2024-03-13 07:54:03       41 阅读
  6. 使用node.js 开发后端的优缺点

    2024-03-13 07:54:03       45 阅读
  7. WebStrom报错

    2024-03-13 07:54:03       46 阅读
  8. 简单的torch网络模型记录

    2024-03-13 07:54:03       48 阅读