在docker下部署Gitlab无法正常启动

2019-04-11 09:26发布

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

请问这个问题怎么解决?

标签: docker gitlab
1条回答
萌系小妹纸
2楼-- · 2019-04-11 10:08

参考 ssh “permissions are too open” error

# chmod 400 /etc/gitlab/ssh_host_ed25519_key
查看更多
登录 后发表回答