Describe your question in as much detail as possible:
I have self-managed Gitlab on my localhost.
I’m trying to register Gitlab Runner through Docker. Here is my docker-compose.yml
version: "3.0"
services:
web:
image: 'gitlab/gitlab-ce:latest'
restart: always
hostname: 'gitlab.my.test'
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'https://gitlab.my.test'
letsencrypt['enable'] = false
# Add any other gitlab.rb configuration here, each on its own line
ports:
- '80:80'
- '443:443'
- '22:22'
volumes:
- './export/containers/gitlab/config:/etc/gitlab'
- './export/containers/gitlab/logs:/var/log/gitlab'
- './export/containers/gitlab/data:/var/opt/gitlab'
gitlab-runner:
image: gitlab/gitlab-runner:latest
container_name: gitlab-runner
restart: always
depends_on:
- web
volumes:
- ./export/containers/gitlab-runner/config:/etc/gitlab-runner
- ./export/containers/gitlab-runner/var/run/docker.sock:/var/run/docker.sock
-
What are you seeing, and how does that differ from what you expect to see?
I usedocker run --rm -it -v /my-path/gitlab-runner/config:/etc/gitlab-runner gitlab/gitlab-runner register
and expect the runner to be registered, but I get:
ERROR: Registering runner... failed runner=UVjXdea- status=couldn't execute POST against https://gitlab.my.test/api/v4/runners: Post https://gitlab.my.test/api/v4/runners: dial tcp: lookup gitlab.my.test on 192.168.0.1:53: no such host
PANIC: Failed to register the runner. You may be having network problems.
-
What version are you on? Are you using self-managed or GitLab.com?
-
GitLab (Hint:
/help
): latest -
Runner (Hint:
/admin/runners
): latest
-
GitLab (Hint:
-
What troubleshooting steps have you already taken? Can you link to any docs or other resources so we know where you have been?
I’ve seen Run GitLab Runner in a container | GitLab and Registering runners | GitLab