Answers: <p>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 <code>tcpdump</code> over the docker bridge to track the blocker.</p>
  <p>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.</p>
  <pre><code>drone:
      image: drone/drone:2.0.4
      privileged: true
      container_name: drone
      hostname: drone
  </code></pre>
  
Answers: CC BY-SA 4.0
Answers: 2021-08-11T17:15:42.557Z
Answers: 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.
Answers: radmacher
Answers: CC BY-SA 4.0
Answers: 2021-08-11T14:56:27.710Z
Answers: 2021-08-11T14:56:27.710Z
Answers: Arvind Rawat
Body: <p>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.</p>
  <p>This is my docker compose file (I have removed some information):</p>
  <pre><code>  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:
        - &quot;/var/run/docker.sock:/var/run/docker.sock:rw&quot;
  
  networks:
    traefik-network:
      external: true
      name: traefik
  
  </code></pre>
  <p>I made sure that I can ping <a href="https://github.com" rel="nofollow noreferrer">github.com</a> 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:</p>
  <pre><code>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
  </code></pre>
  <p>Also, here is the output of the clone step:</p>
  <pre><code>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
  </code></pre>
  
Tags: <docker><dns>
Title: Drone is unable to clone GitHub Project
UserDisplayName: radmacher
ThreadText: # Drone is unable to clone GitHub Project
  
  (Asked by: username_0 on 2021-08-07)
  
  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](https://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
  
  ```
  
  **Tags:** docker, dns
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-08-11. Score: 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
  
  ```
  
  > **Comments:**
  > **username_0**: 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.  
  
  ---
  
  