使用docker-compose 安装gitlab报错 sudo gitlab-ctl reconfigure

使用 docker-compose 管理 gitlab
执行 docker-compose up -d后,启动不成功
使用 docker-compose logs -f后 看到报下面这些错

Preparing services...
Starting services...
Configuring GitLab package...
/opt/gitlab/embedded/bin/runsvdir-start: line 24: ulimit: pending signals: cannot modify limit: Operation not permitted
/opt/gitlab/embedded/bin/runsvdir-start: line 29: ulimit: open files: cannot modify limit: Operation not permitted
/opt/gitlab/embedded/bin/runsvdir-start: line 34: ulimit: max user processes: cannot modify limit: Operation not permitted
/opt/gitlab/embedded/bin/runsvdir-start: line 37: /proc/sys/fs/file-max: Read-only file system
Malformed configuration JSON file found at /opt/gitlab/embedded/nodes/144.202.9.30.json.
This usually happens when your last run of `gitlab-ctl reconfigure` didn't complete successfully.
This file is used to check if any of the unsupported configurations are enabled,
and hence require a working reconfigure before upgrading.
Please run `sudo gitlab-ctl reconfigure` to fix it and try again.
Thank you for using GitLab Docker Image!
Current version: gitlab-ce=11.1.2-ce.0

Configure GitLab for your system by editing /etc/gitlab/gitlab.rb file
And restart this container to reload settings.
To do it use docker exec:

docker exec -it gitlab vim /etc/gitlab/gitlab.rb
docker restart gitlab

For a comprehensive list of configuration options please see the Omnibus GitLab readme
https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md

If this container fails to start due to permission problems try to fix it by executing:

docker exec -it gitlab update-permissions
docker restart gitlab

Preparing services...
Starting services...
Configuring GitLab package...
/opt/gitlab/embedded/bin/runsvdir-start: line 24: ulimit: pending signals: cannot modify limit: Operation not permitted
/opt/gitlab/embedded/bin/runsvdir-start: line 29: ulimit: open files: cannot modify limit: Operation not permitted
/opt/gitlab/embedded/bin/runsvdir-start: line 34: ulimit: max user processes: cannot modify limit: Operation not permitted
/opt/gitlab/embedded/bin/runsvdir-start: line 37: /proc/sys/fs/file-max: Read-only file system
Malformed configuration JSON file found at /opt/gitlab/embedded/nodes/144.202.9.30.json.
This usually happens when your last run of `gitlab-ctl reconfigure` didn't complete successfully.
This file is used to check if any of the unsupported configurations are enabled,
and hence require a working reconfigure before upgrading.
Please run `sudo gitlab-ctl reconfigure` to fix it and try again.

docker-compose.yml文件配置为

version: '3.1'
services:
 gitlab:
  image: 'twang2218/gitlab-ce-zh:11.1.4'
  container_name: "gitlab"
  restart: always
  privileged: true
  hostname: 'gitlab'
  environment:
   TZ: 'Asia/Shanghai'
   GITLAB_OMNIBUS_CONFIG: 
    external_url 'http://172.16.195.134'   # 配置当前服务器ip
    gitlab_rails['time_zone'] = 'Asia/Shanghai'
    gitlab_rails['smtp_enable'] = true
    gitlab_rails['gitlab_shell_ssh_port'] = 22
  ports:
   - '80:80'
   - '443:443'
   - '22:22'
  volumes:
   - /usr/local/gitlab/compose01/config:/etc/gitlab
   - /usr/local/gitlab/compose01/data:/var/opt/gitlab
   - /usr/local/gitlab/compose01/logs:/var/log/gitlab

网上找了很多种办法都没有处理解决,这个时候想起来我有配置 日志 数据卷,到/usr/local/gitlab/compose01/logs/reconfigure目录下,看最新的日志,结尾出现这样的错误:

[2020-08-29T18:03:03+08:00] FATAL: SyntaxError: (eval):1: syntax error, unexpected tIDENTII
FIER, expecting end-of-input
//172.16.195.134' gitlab_rails['time_zone'] = 'Asia/Shanghai

是不是 yml文件配错了,百度别人是怎么配置的,发现少了一个|

environment:
   TZ: 'Asia/Shanghai'
   GITLAB_OMNIBUS_CONFIG:  | 
    external_url 'http://172.16.195.134' 

GITLAB_OMNIBUS_CONFIG后面少写了一个 |,补充完成后,可以正常执行

  • 5
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
使用docker-compose安装GitLab,需要按照以下步骤进行操作: 1. 下载GitLab镜像: 使用以下命令下载GitLab社区版镜像: ``` docker pull gitlab/gitlab-ce:latest ``` 2. 创建docker-compose.yaml文件并进行配置: 创建一个docker-compose.yaml文件,并在其中配置GitLab的相关信息。下面是一个示例配置: ``` version: '3.6' services: web: image: 'gitlab/gitlab-ce:latest' restart: always hostname: 'www.mygitlab.com' environment: TZ: 'Asia/Shanghai' GITLAB_OMNIBUS_CONFIG: | external_url 'http://192.168.182.110:30080' # 添加其他gitlab.rb配置,每行一个 ports: - '30080:30080' - '30443:443' - '30022:22' volumes: - './config:/etc/gitlab' - './logs:/var/log/gitlab' - './data:/var/opt/gitlab' shm_size: '256m' ``` 3. 执行部署: 使用以下命令执行部署: ``` docker-compose -f docker-compose.yml up -d ``` 4. 检查部署状态: 使用以下命令检查GitLab的部署状态: ``` docker-compose -f<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* *3* [通过 docker-compose 快速部署 gitlab](https://blog.csdn.net/qq_35745940/article/details/130188203)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 100%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值