我在docker-file下运行Git Lab时遇到问题。
每当我运行它时,我都会收到Lets-Encrypt错误消息,实际上我的dns名称dev.domain.com
仅作为dev
输入,而没有其余的dns名称。
我尝试在网络上搜索具有相同错误的相关问题,但发现的答案并不能直接解决我的问题。 我已尝试确保yml文件中的格式没有问题,而且还不错。
docker-compose.yml
version: '3'
services:
gitLab:
image: 'gitlab/gitlab-ce:latest'
restart: always
hostname: "dev.domain.com"
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url = "https://dev.domain.com"
nginx['redirect_http_to_https'] = true
letsencrypt['enable'] = true
letsencrypt['contact_emails'] = ['email@gmail.com']
letsencrypt['auto_renew'] = true
letsencrypt['auto_renew_hour'] = "12"
letsencrypt['auto_renew_minute'] = "30"
letsencrypt['auto_renew_day_of_month'] = "*/7"
ports:
- '80:80'
- '443:443'
- '1025:22'
volumes:
- '/srv/gitlab/config:/etc/gitlab'
- '/srv/gitlab/logs:/var/log/gitlab'
- '/srv/gitlab/data:/var/opt/gitlab'
该软件因此错误而停止
gitLab_1 | ============================================================== ==================
gitLab_1 | Error executing action `create` on resource 'acme_certificate[ staging]'
gitLab_1 | ============================================================== ==================
gitLab_1 |
gitLab_1 | Acme::Client::Error::RejectedIdentifier
gitLab_1 | ---------------------------------------
gitLab_1 | Error creating new order :: Cannot issue for "dev": DNS name d oes not have enough labels
gitLab_1 |
gitLab_1 | Cookbook Trace:
gitLab_1 | ---------------
gitLab_1 | /opt/gitlab/embedded/cookbooks/cache/cookbooks/acme/libraries/ acme.rb:47:in `acme_order_certs_for'
gitLab_1 | /opt/gitlab/embedded/cookbooks/cache/cookbooks/acme/resources/ certificate.rb:76:in `block in class_from_file'
gitLab_1 |
gitLab_1 | Resource Declaration:
gitLab_1 | ---------------------
gitLab_1 | suppressed sensitive resource output
gitLab_1 |
gitLab_1 | Compiled Resource:
gitLab_1 | ------------------
gitLab_1 | suppressed sensitive resource output
gitLab_1 |
gitLab_1 | System Info:
gitLab_1 | ------------
gitLab_1 | chef_version=14.13.11
gitLab_1 | platform=ubuntu
gitLab_1 | platform_version=16.04
gitLab_1 | ruby=ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux]
gitLab_1 | program_name=/opt/gitlab/embedded/bin/chef-client
gitLab_1 | executable=/opt/gitlab/embedded/bin/chef-client
gitLab_1 |
gitLab_1 |
gitLab_1 | ================================================================ ================
gitLab_1 | Error executing action `create` on resource 'letsencrypt_certifi cate[dev]'
gitLab_1 | ================================================================ ================
gitLab_1 |
gitLab_1 | Acme::Client::Error::RejectedIdentifier
gitLab_1 | ---------------------------------------
gitLab_1 | acme_certificate[staging] (/opt/gitlab/embedded/cookbooks/cache/ cookbooks/letsencrypt/resources/certificate.rb line 25) had an error: Acme::Clie nt::Error::RejectedIdentifier: Error creating new order :: Cannot issue for "dev ": DNS name does not have enough labels
gitLab_1 |
gitLab_1 | Cookbook Trace:
gitLab_1 | ---------------
gitLab_1 | /opt/gitlab/embedded/cookbooks/cache/cookbooks/acme/libraries/ac me.rb:47:in `acme_order_certs_for'
gitLab_1 | /opt/gitlab/embedded/cookbooks/cache/cookbooks/acme/resources/ce rtificate.rb:76:in `block in class_from_file'
gitLab_1 |
gitLab_1 | Resource Declaration:
gitLab_1 | ---------------------
gitLab_1 | # In /opt/gitlab/embedded/cookbooks/cache/cookbooks/letsencrypt/ recipes/http_authorization.rb
gitLab_1 |
gitLab_1 | 5: letsencrypt_certificate site do
gitLab_1 | 6: crt node['gitlab']['nginx']['ssl_certificate']
gitLab_1 | 7: key node['gitlab']['nginx']['ssl_certificate_key']
gitLab_1 | 8: notifies :run, "execute[reload nginx]", :immediate
gitLab_1 | 9: notifies :run, 'ruby_block[display_le_message]'
gitLab_1 | 10: only_if { omnibus_helper.service_up?('nginx') }
gitLab_1 | 11: end
gitLab_1 |
gitLab_1 | Compiled Resource:
gitLab_1 | ------------------
gitLab_1 | # Declared in /opt/gitlab/embedded/cookbooks/cache/cookbooks/let sencrypt/recipes/http_authorization.rb:5:in `from_file'
gitLab_1 |
gitLab_1 | letsencrypt_certificate("dev") do
gitLab_1 | action [:create]
gitLab_1 | default_guard_interpreter :default
gitLab_1 | declared_type :letsencrypt_certificate
gitLab_1 | cookbook_name "letsencrypt"
gitLab_1 | recipe_name "http_authorization"
gitLab_1 | crt "/etc/gitlab/ssl/dev.iconcode.icu.crt"
gitLab_1 | key "/etc/gitlab/ssl/dev.iconcode.icu.key"
gitLab_1 | alt_names []
gitLab_1 | cn "dev"
gitLab_1 | only_if { #code block }
gitLab_1 | end
gitLab_1 |
gitLab_1 | System Info:
gitLab_1 | ------------
gitLab_1 | chef_version=14.13.11
gitLab_1 | platform=ubuntu
gitLab_1 | platform_version=16.04
gitLab_1 | ruby=ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux]
gitLab_1 | program_name=/opt/gitlab/embedded/bin/chef-client
gitLab_1 | executable=/opt/gitlab/embedded/bin/chef-client
gitLab_1 |
gitLab_1 |
gitLab_1 | Running handlers:
gitLab_1 | There was an error running gitlab-ctl reconfigure:
gitLab_1 |
gitLab_1 | letsencrypt_certificate[dev] (letsencrypt::http_authorization line 5 ) had an error: Acme::Client::Error::RejectedIdentifier: acme_certificate[stagin g] (/opt/gitlab/embedded/cookbooks/cache/cookbooks/letsencrypt/resources/certifi cate.rb line 25) had an error: Acme::Client::Error::RejectedIdentifier: Error cr eating new order :: Cannot issue for "dev": DNS name does not have enough labels