I'm trying to set up drone, but when running a build it fails at the clone step. I'm pretty sure this is a DNS issue and that I just configured the runner wrong, but I just can't figure it out.
This is my docker compose file (I have removed some information):
drone:
image: drone/drone:2.0.4
container_name: drone
hostname: drone
restart: unless-stopped
depends_on:
- postgres
environment:
- DRONE_GITHUB_SERVER=https://github.com
- DRONE_GITHUB_CLIENT_ID=
- DRONE_GITHUB_CLIENT_SECRET=
- DRONE_RPC_SECRET=
- DRONE_SERVER_HOST=
- DRONE_SERVER_PROTO=https
- DRONE_DATABASE_DRIVER=postgres
- DRONE_DATABASE_DATASOURCE=postgres://@postgres:5432/drone?sslmode=disable
networks:
- traefik-network
volumes:
- drone-data:/data
drone-runner-1:
image: drone/drone-runner-docker:1.6.3
container_name: drone-runner-1
hostname: drone-runner-1
restart: unless-stopped
environment:
- DRONE_RPC_HOST=
- DRONE_RPC_PROTO=https
- DRONE_RPC_SECRET=
- DRONE_RUNNER_CAPACITY=2
- DRONE_RUNNER_NAME=${HOSTNAME}
- DRONE_RUNNER_NETWORKS=traefik
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:rw"
networks:
traefik-network:
external: true
name: traefik
I made sure that I can ping github.com from the traefik network, so that shouldn't be an issue, right? But when I try to ping github from the runner container I get the following output:
root@Ubuntu-2004-focal-64-minimal ~ # docker exec -it drone-runner-1 nslookup github.com
Server: 127.0.0.11
Address: 127.0.0.11:53
Non-authoritative answer:
*** Can't find github.com: No answer
Non-authoritative answer:
Name: github.com
Address: 140.82.121.3
Also, here is the output of the clone step:
Initialized empty Git repository in /drone/src/.git/
+ git fetch origin +refs/heads/master:
fatal: unable to access 'https://github.com/[REPO]': Could not resolve host: github.com