OS:Ubuntu 18.04.2
Docker:18.09.2
Image: gitlab/gitlab-ce:latest
启动命令
sudo docker run -d \ --hostname 192.168.1.1 \ --publish 8443:443 --publish 8081:80 --publish 8022:22 \ --name gitlab \ --privileged=true \ --volume /Gitlab/config:/etc/gitlab \ --volume /Gitlab/logs:/var/log/gitlab \ --volume /Gitlab/data:/var/opt/gitlab \ gitlab/gitlab-ce:latest
但是容器启动后状态一直是 Up 1 seconds (health: starting) 启动中
约30~40秒后退出
查看日志 current
2019-04-09_03:38:46.47958 @ WARNING: UNPROTECTED PRIVATE KEY FILE! @ 2019-04-09_03:38:46.47971 Permissions 0777 for '/etc/gitlab/ssh_host_ed25519_key' are too open. 2019-04-09_03:38:46.47978 It is required that your private key files are NOT accessible by others. 2019-04-09_03:38:46.47983 This private key will be ignored. 2019-04-09_03:38:46.47987 key_load_private: bad permissions 2019-04-09_03:38:46.47992 Could not load host key: /etc/gitlab/ssh_host_ed25519_key 2019-04-09_03:38:46.48018 Server listening on 0.0.0.0 port 22. 2019-04-09_03:38:46.48230 Server listening on :: port 22.
[2019-04-09T03:39:21+00:00] INFO: Running queued delayed notifications before re-raising exception [2019-04-09T03:39:21+00:00] INFO: Running queued delayed notifications before re-raising exception [2019-04-09T03:39:21+00:00] ERROR: Running exception handlers [2019-04-09T03:39:21+00:00] ERROR: Exception handlers complete [2019-04-09T03:39:21+00:00] FATAL: Stacktrace dumped to /opt/gitlab/embedded/cookbooks/cache/chef-stacktrace.out [2019-04-09T03:39:21+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report [2019-04-09T03:39:21+00:00] FATAL: Mixlib::ShellOut::ShellCommandFailed: storage_directory[/var/opt/gitlab/.ssh] (gitlab::gitlab-shell line 38) had an error: Mixlib::ShellOut::ShellCommandF ailed: ruby_block[directory resource: /var/opt/gitlab/.ssh] (/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/resources/storage_directory.rb line 33) had an error: Mixlib::ShellOut::S hellCommandFailed: Failed asserting that ownership of "/var/opt/gitlab/.ssh" was git:git ---- Begin output of set -x && [ "$(stat --printf='%U:%G' $(readlink -f /var/opt/gitlab/.ssh))" = 'git:git' ] ---- STDOUT: STDERR: + readlink -f /var/opt/gitlab/.ssh + stat --printf=%U:%G /var/opt/gitlab/.ssh + [ root:root = git:git ] ---- End output of set -x && [ "$(stat --printf='%U:%G' $(readlink -f /var/opt/gitlab/.ssh))" = 'git:git' ] ---- Ran set -x && [ "$(stat --printf='%U:%G' $(readlink -f /var/opt/gitlab/.ssh))" = 'git:git' ] returned 1
请问这个问题怎么解决?
参考 ssh “permissions are too open” error:
# chmod 400 /etc/gitlab/ssh_host_ed25519_key
我刚刚看到了了这个权限问题,原因是物理路径这个硬盘原来是Windows上的,格式是NTFS,所有文件权限都是0777,所以我把config和log两个物理路径,换到了一个ext4格式的磁盘里。
现在权限因该OK了,current里的只剩下两行了
2019-04-09_03:38:46.48018 Server listening on 0.0.0.0 port 22.
2019-04-09_03:38:46.48230 Server listening on :: port 22.
但是log里的还是跟上面一样。
[2019-04-09T06:03:57+00:00] INFO: Running queued delayed notifications before re-raising exception [2019-04-09T06:03:57+00:00] INFO: Running queued delayed notifications before re-raising exception [2019-04-09T06:03:57+00:00] ERROR: Running exception handlers [2019-04-09T06:03:57+00:00] ERROR: Exception handlers complete [2019-04-09T06:03:57+00:00] FATAL: Stacktrace dumped to /opt/gitlab/embedded/cookbooks/cache/chef-stacktrace.out [2019-04-09T06:03:57+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report [2019-04-09T06:03:57+00:00] FATAL: Mixlib::ShellOut::ShellCommandFailed: storage_directory[/var/opt/gitlab/.ssh] (gitlab::gitlab-shell line 38) had an error: Mixlib::ShellOut::S hellCommandFailed: ruby_block[directory resource: /var/opt/gitlab/.ssh] (/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/resources/storage_directory.rb line 33) had an er ror: Mixlib::ShellOut::ShellCommandFailed: Failed asserting that ownership of "/var/opt/gitlab/.ssh" was git:git ---- Begin output of set -x && [ "$(stat --printf='%U:%G' $(readlink -f /var/opt/gitlab/.ssh))" = 'git:git' ] ---- STDOUT: STDERR: + readlink -f /var/opt/gitlab/.ssh + stat --printf=%U:%G /var/opt/gitlab/.ssh + [ root:root = git:git ] ---- End output of set -x && [ "$(stat --printf='%U:%G' $(readlink -f /var/opt/gitlab/.ssh))" = 'git:git' ] ---- Ran set -x && [ "$(stat --printf='%U:%G' $(readlink -f /var/opt/gitlab/.ssh))" = 'git:git' ] returned 1