Cannot connect to consul in drone

As per the example on the docs , I have a config file that looks like


workspace:
  base: /go
  path: src/github.com/adelowo/gotils

pipeline:
  fmt_check:
    image: golang
    pull: true
    commands:
      - make verify_goimports
      - make fmt-check

  vet:
    image: golang
    pull: true
    commands:
      - make dependencies
      - make vet

  integration:
    image: golang
    pull: true
    environment:
      - CONSUL_HTTP_ADDR=discovery:8500
    commands:
      - make dependencies
      - make integration_tests

services:
  discovery:
    image: consul:latest

    ports:
      - "8400:8400"
      - "8500:8500"
      - "8600:8600"
    command: "agent -dev"

But in my Golang tests, I keep on getting Put http://discovery:8500/v1/agent/service/register: dial tcp 192.168.0.2:8500: connect: connection refused… See the build https://ci.lanre.wtf/adelowo/gotils/5/6

If code clarification is needed, it is at https://github.com/adelowo/gotils/pull/2

Thanks

as a side note, this ports attribute is not supported and therefore doesn’t do anything:

    ports:
      - "8400:8400"
      - "8500:8500"
      - "8600:8600"

you do not need to specify host port mappings because all containers share a bridge network, and therefore can access via hostname on the bridge.

when you define un-recognized fields (in this case, ports) it can cause Drone to execute a container as a plugin instead of a service. I’m not sure this is the problem in this case, but you should definitely remove ports just to be sure.

Thanks… Just tried it and it failed again https://ci.lanre.wtf/adelowo/gotils/7/6

Weird enough this same codebase passes on another drone instance ( connected to Gitea though ? ) … Not related in any way but just weird