docker 安装gitlab

Docker方式安装参考:

https://docs.gitlab.com/ee/install/docker.html

https://docs.gitlab.cn/jh/install/docker.html

1.确保docker与docker-compose安装运行正常

docker version

docker-compose version

2.关闭防火墙

sudo systemctl stop firewalld

sudo systemctl disable firewalld

sudo systemctl status firewalld

3.创建gitlab的docker目录 与 编排文件

mkdir -p /usr/local/docker/gitlab_docker

vim /usr/local/docker/gitlab_docker/docker-compose.yml

4.搜索可用镜像:

docker search --no-trunc gitlab/gitlab-ce

root@VM-0-15-centos local# docker search --no-trunc gitlab-ce

NAME DESCRIPTION STARS OFFICIAL AUTOMATED

gitlab/gitlab-ce GitLab Community Edition docker image based on the Omnibus package 4124 OK

twang2218/gitlab-ce-zh 汉化的 GitLab 社区版 Docker Image 272 OK

yrzr/gitlab-ce-arm64v8 GitLab Community Edition docker image for arm64v8 97

beginor/gitlab-ce GitLab Community Edition with zh-cn 76 OK

drud/gitlab-ce 18

rapidfort/gitlab-ce 12

gitlab/gitlab-ce-qa GitLab QA has a test suite that allows end-to-end tests. https://gitlab.com/gitlab-org/gitlab-qa 11

slpcat/gitlab-ce gitlab-ce最新社区版10.1.0,omnibus二进制包

5.拉取指定版本的镜像

标签组成形式:gitlab/gitlab-ce:<version>-ce.0

docker pull gitlab/gitlab-ce:15.11.13-ce.0

镜像较大,需要等待一段时间

root@VM-0-15-centos local# docker pull gitlab/gitlab-ce:15.11.13-ce.0

15.11.13-ce.0: Pulling from gitlab/gitlab-ce

0fb668748fc8: Pull complete

50256ec22a42: Pull complete

6ca7ce146549: Pull complete

48405c84afa2: Pull complete

23a5915b0081: Pull complete

86dbcd9b238b: Pull complete

8484747aef83: Pull complete

ba2265443458: Pull complete

Digest: sha256:798b18325a90851922c916fcded34d1ba7decf810a311765b43e43f452bf564c

Status: Downloaded newer image for gitlab/gitlab-ce:15.11.13-ce.0

docker.io/gitlab/gitlab-ce:15.11.13-ce.0

root@VM-0-15-centos local#

docker images

6.编写/usr/local/docker/gitlab_docker/docker-compose.yml 编排文件

version: '3.6'

services:

gitlab:

image: gitlab/gitlab-ce:15.11.13-ce.0

container_name: gitlab

restart: always

hostname: 'gitlab.example.com'

environment:

GITLAB_OMNIBUS_CONFIG: |

Add any other gitlab.rb configuration here, each on its own line

external_url 'https://gitlab.example.com'

ports:

  • '80:80'

  • '443:443'

  • '22:22'

volumes:

  • '$GITLAB_HOME/config:/etc/gitlab'

  • '$GITLAB_HOME/logs:/var/log/gitlab'

  • '$GITLAB_HOME/data:/var/opt/gitlab'

shm_size: '256m'

version: '3.1'

services:

gitlab:

image: gitlab/gitlab-ce:15.11.13-ce.0

container_name: gitlab

restart: always

environment:

GITLAB_OMNIBUS_CONFIG: |

external_url 'http://118.195.219.5:8989'

gitlab_rails'gitlab_ssh_host' = '192.168.172.128'

gitlab_rails'initial_root_password' = 'fanqi&coreqi&7'

gitlab_rails'gitlab_shell_ssh_port' = 2224

ports:

  • '8989:8989'

  • '2224:2224'

volumes:

  • './config:/etc/gitlab'

  • './logs:/var/log/gitlab'

  • './data:/var/opt/gitlab'

shm_size: '256m'

7.启动:docker-compose up -d

注意:首次启动需要等待一段时间

8.访问:ip:port
9.进入容器获取登录密码

docker exec -it gitlab bash

cat /etc/gitlab/initial_root_password

root@217169d93d4c:/# 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: 7p9FmsSYIaQ1S60tddk1ymIB/6r4lCSerNXjGxqmuWA=

NOTE: This file will be automatically deleted in the first reconfigure run after 24 hours.

root@217169d93d4c:/#

10.使用root用户名和上面的密码登录gitlab
11.修改密码

右上角用户log下拉 - Preferences - 左侧导航Password -

Current password:7p9FmsSYIaQ1S60tddk1ymIB/6r4lCSerNXjGxqmuWA=

设置的密码不能小于8位字符

neil123456

12.重新登录
13.docker 命令启动方式示例

docker run \

--detach \

--privileged=true \

-e GITLAB_OMNIBUS_CONFIG="external_url 'http://192.168.172.128:8989' \

--hostname 192.168.172.128 \

--publish 443:443 --publish 8989:8989 --publish 22:22 \

--name gitlab \

--restart unless-stopped \

--volume ./config:/etc/gitlab \

--volume ./logs:/var/log/gitlab \

--volume ./data:/var/opt/gitlab \

gitlab/gitlab-ce:15.11.13-ce.0

完成!

gitlab下载地址

https://packages.gitlab.com/gitlab/gitlab-ce?filter=rpms

https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-15.11.13-ce.0.el7.x86_64.rpm

https://packages.gitlab.com/gitlab/gitlab-ce?filter=rpms\&page=31

相关推荐
武子康16 小时前
调查研究-183 Apple container:Mac 上用轻量 VM 跑 Linux 容器,Swift 会改写本地容器体验吗?
docker·容器·apple
Alsn864 天前
等待学习-学习目录:Docker 容器安全攻防
学习·安全·docker
JLWcai202510094 天前
铸造领域树脂砂轮|金利威多场景解决方案,20 + 配方覆盖全需求
mongodb·zookeeper·eureka·spark·rabbitmq·memcached·storm
程序员老赵4 天前
服务器没有桌面?Docker 跑个 Chrome,浏览器就能远程用
docker·容器·devops
杨浦老苏4 天前
轻量级Docker仪表板Servedash
运维·docker·监控·群晖·仪表板
正经教主4 天前
【docker基础】 第八周:容器监控与应用更新策略
运维·docker·容器
kiros_wang4 天前
Docker 使用完整指南
运维·docker·容器
正经教主4 天前
【docker基础】第九周:Docker安全与镜像优化
运维·docker·容器
CodeStats4 天前
【虚拟机】 从 CPU 指令到虚拟机隔离:虚拟机就是一个“模拟了完整硬件的普通进程”
java·docker
ai产品老杨4 天前
突破安防碎片化:基于 Docker 与边缘计算的 AI 视频智能化中台,如何通过 GB28181/RTSP 统一接入与全套源码交付实现二次开发自由?
人工智能·docker·边缘计算