docker

package module
v0.0.0-...-5bbba1b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

README

coredns-docker

Build Status Code Coverage Go Report Card

Name

docker - enables serving zone data based on docker container names

Description

The docker plugin is useful for development environments so you can access containers by their names. This plugin is not intended for production usage.

Syntax

The plugin is activated by using its name without any additional parameters

. {
  docker
}

Example

The configuration bellow will match containers by their names without using any zone:

. {
  docker
  forward . 8.8.8.8
}

For instance, if you have a container named my-nginx, it will return something like this:

my-nginx.   0      IN      A       172.25.0.2

In case you want my-nginx under a particular zone, you could use:

localdomain {
  docker
}

Then you would get:

my-nginx.localdomain.   0      IN      A       172.25.0.2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerCli

type DockerCli interface {
	client.ContainerAPIClient
	client.SystemAPIClient
}

type DockerDNS

type DockerDNS struct {
	// contains filtered or unexported fields
}

func NewDockerDNS

func NewDockerDNS(domains []string, cli DockerCli) (*DockerDNS, error)

func (*DockerDNS) GetRecords

func (d *DockerDNS) GetRecords() map[string][]dns.RR

type DockerPlugin

type DockerPlugin struct {
	// contains filtered or unexported fields
}

func (*DockerPlugin) Name

func (d *DockerPlugin) Name() string

func (*DockerPlugin) ServeDNS

func (d *DockerPlugin) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error)

ServeDNS implements the plugin.Handler interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL