Hi there,
I have a pipeline where I want to test an api. I build a docker image using the docker plugin, then I start the container from that plugin detached.
In the next pipeline step I would like to run a program which connects to the service. This does not work and gives me the following error:
EndpointWriter failed to connect address="customerservice:9010" error="rpc error: code = Unavailable
desc = all SubConns are in TransientFailure, latest connection error: connection error: desc =
\"transport: Error while dialing dial tcp: lookup customerservice on 127.0.0.11:53: no such host\""
I am running drone with the docker runner. My docker-compose-file looks like:
version: "3"
services:
nginx:
build:
context: .
dockerfile: nginx.dockerfile
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- /home/obraun/certs:/etc/nginx/certs:ro
ports:
- 80:80
- 443:443
depends_on:
- drone
networks:
- frontend
- backend
restart: always
drone:
image: drone/drone:1
volumes:
- /home/dronedata:/data
environment:
- VIRTUAL_HOST=...
- VIRTUAL_PORT=...
- DRONE_AGENTS_ENABLED=true
- DRONE_GITHUB_CLIENT_ID=...
- DRONE_GITHUB_CLIENT_SECRET=...
- DRONE_RPC_SECRET=...
- DRONE_SERVER_HOST=...
- DRONE_SERVER_PROTO=https
- DRONE_USER_CREATE=...
networks:
- backend
restart: always
runner:
image: drone/drone-runner-docker:1
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- DRONE_RPC_PROTO=http
- DRONE_RPC_HOST=drone
- DRONE_RPC_SECRET=...
- DRONE_RUNNER_CAPACITY=15
- DRONE_RUNNER_NAME=runner
depends_on:
- drone
networks:
- backend
restart: always
networks:
frontend:
backend:
My drone.yml
looks like this:
kind: pipeline
type: docker
name: default
steps:
- name: docker (customerservice)
image: plugins/docker
settings:
dockerfile: customer/service/Dockerfile
username: obcode
password:
from_secret: gh_token
registry: docker.pkg.github.com
repo: docker.pkg.github.com/vesose/solutionb1/customerservice
when:
branch:
- master
- develop
- name: customerservice
image: docker.pkg.github.com/vesose/solutionb1/customerservice
detach: true
- name: test (customerservice)
image: obraun/golang-protoactor-ci
commands:
- sleep 5
- go run apitest/customer.go -use-external-service -service=customerservice:9010
image_pull_secrets:
- dockerconfig
Any hints or help would be very great.
Thanks
Olli