0

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
1

I guess there is an issue with your overlay network which has been created by the docker command. The host machine able to ping the GitHub means we are blocking somewhere in the docker network. you can do tcpdump over the docker bridge to track the blocker.

you can do some changes on your docker-compose.yaml to test it as below as a workaround. Add privileged on the container just access the host DNS.

drone:
    image: drone/drone:2.0.4
    privileged: true
    container_name: drone
    hostname: drone
1
  • I'm not quite sure I can follow. I used tcpdump -i docker0 to attach to the docker network, then I started a new build, but I'm not seeing any output. I also added that privileged: true to both the runner and the server itself, but that did not fix it either.
    – radmacher
    Aug 11 at 17:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.