According to the GitLab CI Runner Advanced configuration, you can try playing with a parameter extra_hostsin your GitLab CI runner. In /etc/gitlab-runner/config.toml:
[[runners]]
url = "http://localhost/ci"
token = "TOKEN"
name = "my_runner"
executor = "docker"
[runners.docker]
host = "tcp://<DOCKER_DAEMON_IP>:2375"
image = "..."
...
extra_hosts = ["localhost:192.168.0.39"]
, , git, localhost, 192.168.0.39 IP .