"Could not resolve host" - on clone step

Can you help me to find the reason of what I’m doing wrong?

I have Gitea and Drone in docker compose:

version: '2'
    image: gitea/gitea:latest
      - ./data/gittea:/data
      - "3000:3000"
      - "2222:22"
    image: drone/drone:1.0.0-rc.3
      - gitea
      - "8000:80"
      - ./data/drone:/var/lib/drone/
      - /var/run/docker.sock:/var/run/docker.sock
      - DRONE_GITEA_SERVER=http://gitea:3000
      - DRONE_SERVER_HOST=drone-server
      - DRONE_TLS_AUTOCERT=false

it is able to fetch list of repositories, acivate repo, add webhooks, and even webhooks working

but when it comes to running pipeline I recieve the following:

(sorry cannot upload screenshot)

here is what is says in browser:

Initialized empty Git repository in /drone/src/.git/
+ git fetch origin +refs/heads/master:
fatal: unable to access 'http://gitea:3000/vitaliy/foobar1.git/': Could not resolve host: gitea

even if I go to drone-server container - I’m able to ping gitea server

even if I go to drone-server container - I’m able to ping gitea server

the Drone server does not clone the repository. Drone spawns a per-pipeline container that is used to clone the repository. It essentially looks like this:

docker run -e DRONE_COMMIT=xxxx -e DRONE_BRANCH=yyyy drone/git

the clone step is just another step in your pipeline container. Each pipeline container is part of a per-container user-defined network. The gogs and drone server are on a separate bridge network in your configuration, and therefore, the user-defined network cannot resolve the gogs hostname.

So how do I configure per-pipeline container to use the same network as drone-server ?

@vitalik i’ve also meet this problem, how is going now?


they added the new env var DRONE_RUNNER_NETWORKS which allows you to set same network for runner container

but unfortunately it is not documented yet

1 Like

thanks , i’ve tried a new machine, and it works. but i don’t know the drone ‘fork’ details of networks. i’ll try your showned opt. many thanks!

@luotianyu1 please see this entry in the faq Problems cloning with Gitea. You can also search this forum for existing threads that discuss the DRONE_RUNNER_NETWORKS and DRONE_GIT_ALWAYS_AUTH and ROOT_URL parameters.

yes , I have looked all title about this question for long day ,other way,I tried it and it seems doesn,t work.
Oh, I am really sad now

I am using drone whit gitHub, and the problem occured…

this is a thread about clone issues with Gitea. If you are having clone problems in GitHub you should either find a thread related to GitHub, or you should create a new thread and you should provide more details (exact error message, you server configuration, your runner configuration, etc).

Initialized empty Git repository in /drone/src/.git/
2 + git fetch origin +refs/heads/master:
3 fatal: unable to access ‘http://gitlab.fcsc.com/luotianyu/lcs_bus.git/’: Could not resolve host: gitlab.fcsc.com

this is the error info