Docker中的GitLab在chgrp上失败



我刚刚在运行64位版本的Raspberry OS的RPI4上冒险进入了Docker的世界。我已经尝试使用这个docker映像来设置GitLab。我已将CIFS文件系统挂载到NAS服务器

//NAS-IP/gitlab  /mnt/gitlab  cifs  username=xxx,password=xxx,iocharset=utf8,rw,file_mode=0777,dir_mode=0777  0  0

我使用它作为提供给GitLab容器的存储卷,我使用以下命令设置:

docker run -d 
-p 4443:443 -p 8080:80 -p 2222:22 
--name gitlab 
--restart always 
-v /home/pi/GitLab/config:/etc/gitlab 
-v /home/pi/GitLab/logs:/var/log/gitlab 
-v /mnt/gitlab/data:/var/opt/gitlab 
ravermeister/gitlab

我不确定我是否应该将所有三个卷指向我的NAS盒或仅指向数据卷(就像我在这里所做的那样)?

根据我在RPI4上的Portainer站点,GitLab容器是健康的/启动/运行,但RPI4一次又一次地运行相同的GitLab进程,并在GitLab日志文件(/home/pi/GitLab/logs/reconfigure)堆中,我可以看到容器中的某些东西失败了:

[2021-03-02T20:03:47+00:00] ERROR: Running exception handlers
[2021-03-02T20:03:47+00:00] ERROR: Exception handlers complete
[2021-03-02T20:03:47+00:00] FATAL: Stacktrace dumped to /opt/gitlab/embedded/cookbooks/cache/chef-stacktrace.out
[2021-03-02T20:03:47+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2021-03-02T20:03:47+00:00] FATAL: Mixlib::ShellOut::ShellCommandFailed: storage_directory[/var/opt/gitlab/.ssh] (gitlab::gitlab-shell line 34) had an error: Mixlib::ShellOut::ShellCommandFailed: ruby_block[directory resource: /var/opt/gitlab/.ssh] (/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/resources/storage_directory.rb line 34) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of chgrp git /var/opt/gitlab/.ssh ----
STDOUT:
STDERR: chgrp: changing group of '/var/opt/gitlab/.ssh': Operation not permitted
---- End output of chgrp git /var/opt/gitlab/.ssh ----
Ran chgrp git /var/opt/gitlab/.ssh returned 1

GitLab容器已经写入了配置,日志和数据卷,所以它有写权限。

这是可以使用我相对有限的linux技能来修复的东西,我可以尝试做什么?

GitLab正在尝试更改.ssh文件夹的组所有权。

容器已经在GitHub上的清单中有关于ACL和组权限的警告:

"如果你在docker主机上使用文件acl, docker[^1]组需要完全访问卷才能使GitLab工作. ...">

所以从检查这个开始。

如果您无法清除主机上已挂载的文件夹/mnt/gitlab/data(该文件夹应该包含容器试图更改的.ssh),则下一步是检查主机上.ssh的当前组是什么以及容器中预期的内容,然后尝试在容器外更改它。根据ACL文件,我期望组为docker

最新更新