kevinjqiu / coredns-dockerdiscovery

Docker Discovery Plugin for CoreDNS
Apache License 2.0
57 stars 29 forks source link

plugin/docker: no next plugin found #37

Open p3lim opened 5 months ago

p3lim commented 5 months ago

I'm getting this error when I query nginx.test through CoreDNS. I've tried multiple combinations of directive options, same result for them all.

I want to use this plugin to handle entries based on Docker labels, and as such my config is this:

test {
  log
  errors
  dnssec

  docker {
    label coredns.host
  }
}

I've spun up the container like this:

version: '2'
services:
  coredns:
    image: ghcr.io/p3lim/coredns:1.11.1 # my image
    restart: unless-stopped
    ports:
      - 53:53/udp
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /srv/Corefile:/Corefile:ro
    networks:
      - ingress

networks:
  ingress:
    external: true

And the container corresponding to the query (separate compose project):

version: '2'
services:
  nginx:
    image: nginx:latest
    ports:
      - 80:80
      - 443:443
    labels:
      coredns.host: nginx.test
    networks:
      - ingress

networks:
  ingress:
    external: true

Link to the custom image: https://github.com/p3lim/coredns
I built it slightly differently from the readme, I followed CoreDNS' docs.

Full log when I query:

coredns-1  | [docker] start
coredns-1  | test.:53
coredns-1  | CoreDNS-1.11.1
coredns-1  | linux/amd64, go1.20.13, ae2bbc2-dirty
coredns-1  | [INFO] 192.168.1.100:35704 - 65421 "A IN nginx.test. udp 50 false 1232" - - 0 0.000043001s
coredns-1  | [ERROR] plugin/errors: 2 nginx.test. A: plugin/docker: no next plugin found
p3lim commented 5 months ago

Lack of functionality was caused by the plugin not working with CoreDNS 1.11.1, I'll raise a separate issue about that.

On 1.10.1 this error still exist when there's no following directive (I just added whoami after and it stops the error, but I don't want to use another directive after this).