Lets Encrypt Certificate Won't Be Created Using Gitlab Docker

I’m running the latest gitlab/gitlab-ce (it’s the same for EE) latest docker image, and using the following gitlab.rb configuration:
letsencrypt[‘enable’] = true
letsencrypt[‘auto_renew’] = true
external_url “https://<MY_DOMAIN>.com”
nginx[‘redirect_http_to_https’] = true

When running gitlab-ctl reconfigure, i get the following log:
Recipe: letsencrypt::disable

  • crond_job[letsencrypt-renew] action delete
    • file[/var/opt/gitlab/crond/letsencrypt-renew] action delete (up to date)
      (up to date)

And also this:

  • letsencrypt_certificate[<MY_DOMAIN>] action create (skipped due to only_if)
    FATAL: Acme::Client::Error::Timeout: letsencrypt_certificate[<MY_IP>] (letsencrypt::http_authorization line 6) had an error: Acme::Client::Error::Timeout: acme_certificate[staging] (letsencrypt::http_authorization line 43) had an error: Acme::Client::Error::Timeout: Acme::Client::Error::Timeout

And at the end, my gitlab runs on port 80 and 443 (where 80 redirects to 443), but the certificate is self signed.

Furthermore, I used the linux package (instead of the docker) with the same configuration, and it worked like a charm.

What am I doing wrong? How can I make the Gitlab’s docker generate let’s Encrypt certificate as it should?

If it’s working with the linux package, what is in your dockerfile / compose file / or flags you are passing in?

Are you exposing all the needed ports? 22, 80, 443, etc so that they are accessible.