使用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后面少写了一个 |,补充完成后,可以正常执行

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值