# Drone Dockerfile testing

**URL:** <https://drone.discourse.group/t/drone-dockerfile-testing/9874>\
**Category:** Drone Support\
**Created:** [August 2, 2021, 7:09pm UTC](https://drone.discourse.group/t/drone-dockerfile-testing/9874 "2021-08-02T19:09:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![modem7](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/modem7/32/6269_2.png) [@modem7](https://drone.discourse.group/u/modem7)\
**Post date:** [August 2, 2021, 7:09pm UTC](https://drone.discourse.group/t/drone-dockerfile-testing/9874/1 "2021-08-02T19:09:46Z")

</div>

Hey guys,

This might be a muppet question.

I’m trying to do a simple test during build to make sure my Dockerfile is working prior to release, but I’m getting a network error.

I’ve got this so far:

> pipeline:  
> restore\_cache:  
> image: drillster/drone-volume-cache:latest  
> restore: true  
> mount:  
> - /var/lib/docker  
> volumes:  
> - /tmp/dockercache:/cache  
> when:  
> event: push  
> branch:  
> - master
> 
> build:  
> image: docker:latest  
> volumes:  
> - /var/run/docker.sock:/var/run/docker.sock  
> commands:  
> - docker build -t modem7/dronetests:${DRONE\_REPO\_BRANCH/master/latest} .  
> when:  
> event: push  
> branch:  
> - master
> 
> dnscrypt:  
> image: modem7/dronetests:${DRONE\_REPO\_BRANCH/master/latest}  
> group: test  
> detach: true  
> when:  
> event: push  
> branch:  
> - master
> 
> pause:  
> image: busybox:latest  
> commands:  
> - sleep 5  
> when:  
> event: push  
> branch:  
> - master
> 
> testing:  
> image: modem7/dronetests:${DRONE\_REPO\_BRANCH/master/latest}  
> group: test  
> # network\_mode: bridge  
> custom\_dns: 127.0.0.1  
> # commands: apk add --no-cache drill && drill -p 53 one.one.one.one @127.0.0.1 || exit 1  
> commands: drill -p 53 one.one.one.one @127.0.0.1 || exit 1  
> when:  
> event: push  
> branch:  
> - master
> 
> publish:  
> image: plugins/docker:1.3  
> username: ${DOCKER\_USERNAME}  
> email: ${DOCKER\_EMAIL}  
> password: ${DOCKER\_PASSWORD}  
> dockerfile: Dockerfile  
> volumes:  
> - /var/run/docker.sock:/var/run/docker.sock  
> repo: modem7/dronetests  
> tag: ${DRONE\_REPO\_BRANCH/master/latest}  
> secrets:  
> - docker\_username  
> - docker\_email  
> - docker\_password  
> when:  
> event: push  
> branch:  
> - master
> 
> rebuild\_cache:  
> image: drillster/drone-volume-cache:latest  
> rebuild: true  
> mount:  
> - /var/lib/docker  
> volumes:  
> - /tmp/dockercache:/cache  
> when:  
> event: push  
> branch:  
> - master

> **[Drone CI](https://drone.modem7.com/modem7/dronetests)**
>
> Drone is a self-service Continuous Integration platform for busy development teams.

![image](https://canada1.discourse-cdn.com/flex003/uploads/testdrone/original/2X/a/a0bb79100684b9deaa78405faaab0b2218395e8d.png)

I’ve tried the custom\_dns variable as well, network mode bridge and host, but still no go.

I’ve also tried doing a “commands” in the dnscrypt step itself, but get the same error (test 15)

It’s definitely got network access during the dnscrypt step, otherwise it wouldn’t output the relevant DNS providers.

I might be missing something as I’m quite new to Drone, or I might be going about it completely the wrong way!

Any assistance would be fantastic and much appreciated.

---

<div class="post-metadata">

**Author:** ![csgitharness](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/csgitharness/32/904_2.png) [@csgitharness](https://drone.discourse.group/u/csgitharness)\
**Post date:** [August 3, 2021, 11:58am UTC](https://drone.discourse.group/t/drone-dockerfile-testing/9874/2 "2021-08-03T11:58:38Z")

</div>

@modem7 ,

Could you please try to run the command `commands: drill -p 53 one.one.one.one @127.0.0.1 || exit 1` directly on the runner to verify if that works once.

---

<div class="post-metadata">

**Author:** ![modem7](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/modem7/32/6269_2.png) [@modem7](https://drone.discourse.group/u/modem7)\
**Post date:** [August 12, 2021, 12:18am UTC](https://drone.discourse.group/t/drone-dockerfile-testing/9874/3 "2021-08-12T00:18:40Z")

</div>

Thank you @csgit - you got me on the right track.

Resolution: drill -p 53 -D one.one.one.one || exit 1

As soon as I removed the 127.0.0.1 it worked.

Thanks!
