# Runner docker - --add-host for clone?

**URL:** <https://drone.discourse.group/t/runner-docker-add-host-for-clone/10626>\
**Category:** Drone Support\
**Created:** [December 14, 2019, 6:56am UTC](https://drone.discourse.group/t/runner-docker-add-host-for-clone/10626 "2019-12-14T06:56:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MatejKovac](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/matejkovac/32/4535_2.png) [@MatejKovac](https://drone.discourse.group/u/MatejKovac)\
**Post date:** [December 14, 2019, 6:56am UTC](https://drone.discourse.group/t/runner-docker-add-host-for-clone/10626/1 "2019-12-14T06:56:58Z")

</div>

Hello,

runner-docker executes containers, even for cloning a repo. Is there a way to specify `extra_hosts` or a docker run command `--add-host` parameter when running the clone container, or any other containers?

---

<div class="post-metadata">

**Author:** ![MatejKovac](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/matejkovac/32/4535_2.png) [@MatejKovac](https://drone.discourse.group/u/MatejKovac)\
**Post date:** [January 3, 2020, 4:27pm UTC](https://drone.discourse.group/t/runner-docker-add-host-for-clone/10626/2 "2020-01-03T16:27:45Z")

</div>

This is still on the table for me, but I may need to extend or give an example. I reviewed source code of drone and the docker runner (and got lost a bit), but see my drone.yml:

```
---
kind: pipeline
type: docker
name: sphinx-builder

clone:
  extra_hosts:
  - "gitea.corp:1.2.3.4"

steps:
- name: something
  image: debian:slim
  extra_hosts:
  - "gitea.corp:1.2.3.4"
  commands:
  - env

```

This produces in `clone` step:

```
Initialized empty Git repository in /drone/src/.git/
+ git fetch origin +refs/heads/master:
fatal: unable to access 'https://gitea.corp/mkovac/dronetest.git/': Could not resolve host: gitea.corp
```

---

<div class="post-metadata">

**Author:** ![MatejKovac](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/matejkovac/32/4535_2.png) [@MatejKovac](https://drone.discourse.group/u/MatejKovac)\
**Post date:** [January 3, 2020, 5:08pm UTC](https://drone.discourse.group/t/runner-docker-add-host-for-clone/10626/3 "2020-01-03T17:08:57Z")

</div>

I solved this temporarily by running extra DNS server. But now I get SSL verification error during clone step:

```
fatal: unable to access 'https://gitea.corp/mkovac/dronetest.git/': SSL certificate problem: self signed certificate in certificate chain

```

None of the `*_SKIP_VERIFY` configuration variables can be used to ignore certificate during clone step. Can custom `DRONE_RUNNER_CLONE_IMAGE` derived from original and injected corporate certification authority be an option, @bradrydzewski ?

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [January 3, 2020, 5:15pm UTC](https://drone.discourse.group/t/runner-docker-add-host-for-clone/10626/4 "2020-01-03T17:15:17Z")

</div>

> [@On another topic](https://drone.discourse.group/t/6492/2):
>
> Could not resolve host

are you running Drone and Gitea on the same machine? If so please see the following thread which discusses the recommended solution: [http://discuss.harness.io/t/drone-docker-agents-on-custom-network/3732/10](http://discuss.harness.io/t/drone-docker-agents-on-custom-network/3732/10)

if you want to disable ssl for cloning see the following thread: [http://discuss.harness.io/t/drone-git-clone-ssl-error/5045/2?u=bradrydzewski](http://discuss.harness.io/t/drone-git-clone-ssl-error/5045/2)

---

<div class="post-metadata">

**Author:** ![MatejKovac](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/matejkovac/32/4535_2.png) [@MatejKovac](https://drone.discourse.group/u/MatejKovac)\
**Post date:** [January 7, 2020, 8:22am UTC](https://drone.discourse.group/t/runner-docker-add-host-for-clone/10626/5 "2020-01-07T08:22:36Z")

</div>

Thanks, solved.

The `skip_verify` deserves to be documented here [https://docs.drone.io/pipeline/docker/syntax/cloning/](https://docs.drone.io/pipeline/docker/syntax/cloning/) since I reviewed it many times and could not find it…

I am not running on a single host, but single swarm cluster - so technically containers can end up together on one machine, but I run into no problems with this. I also setup gitea & drone several times on single docker host without issues.
