Why can't gitlab-runner clone my project? (Incorrect hostname, failed to connect)

As described here, the solution is to replace the entry host: localhost in the Gitlab config file /home/git/gitlab/config/gitlab.yml with the IP address of the host.

Before replacing:

  gitlab:
    ## Web server settings (note: host is the FQDN, do not include http://)
    host: localhost

After replacing:

  gitlab:
    ## Web server settings (note: host is the FQDN, do not include http://)
    host: 10.0.1.2