Hi all,
I have the following docker-compose.yml:
version: '3'
services:
gitlab:
image: gitlab/gitlab-ce:13.6.5-ce.0
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://gitlab'
gitlab_rails['initial_root_password'] = "password"
gitlab_rails['initial_shared_runners_registration_token'] = "token"
ports:
- 8929:80
gitlab-runner:
image: gitlab/gitlab-runner:alpine
container_name: gitlab-runner
depends_on:
- gitlab
restart: always
# command: ["gitlab-runner", "register", "--non-interactive", '--executor "docker"', '--docker-image alpine:latest', '--url "http://gitlab"', '--registration-token "token"', '--description "docker-runner"', '--tag-list "docker,aws"', '--run-untagged="true"', '--locked="false"', '--access-level="not_protected"']
volumes:
- /Users/Shared/gitlab-runner/config:/etc/gitlab-runner
- /var/run/docker.sock:/var/run/docker.sock
Forget about the command on gitlab-runner. I’m running it afterwards, and the runner registers on gitlab.
However the jobs fails with the following error:
fatal: unable to access ‘http://gitlab/root/the-metamorphosis.git/’: Could not resolve host: gitlab
17ERROR: Job failed: exit code 1
But inside the gitlab-runner container I can do: git clone http://gitlab/root/the-metamorphosis.git/
successfully after putting the username and password.
Any ideia of what could be wrong on this setup?
Thanks.