Drone Dockerfile testing

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

image

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.

@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.

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!