package
17.12.1-ce-rc2+incompatible
Repository: https://github.com/docker/cli.git
Documentation: pkg.go.dev
# README
page_title: Docker discovery page_description: discovery page_keywords: docker, clustering, discovery
Discovery
Docker comes with multiple Discovery backends.
Backends
Using etcd
Point your Docker Engine instances to a common etcd instance. You can specify
the address Docker uses to advertise the node using the --cluster-advertise
flag.
$ dockerd -H=<node_ip:2376> --cluster-advertise=<node_ip:2376> --cluster-store etcd://<etcd_ip1>,<etcd_ip2>/<path>
Using consul
Point your Docker Engine instances to a common Consul instance. You can specify
the address Docker uses to advertise the node using the --cluster-advertise
flag.
$ dockerd -H=<node_ip:2376> --cluster-advertise=<node_ip:2376> --cluster-store consul://<consul_ip>/<path>
Using zookeeper
Point your Docker Engine instances to a common Zookeeper instance. You can specify
the address Docker uses to advertise the node using the --cluster-advertise
flag.
$ dockerd -H=<node_ip:2376> --cluster-advertise=<node_ip:2376> --cluster-store zk://<zk_addr1>,<zk_addr2>/<path>
# Functions
CreateEntries returns an array of entries based on the given addresses.
Generate takes care of IP generation.
New returns a new Discovery given a URL, heartbeat and ttl settings.
NewEntry creates a new entry.
ParseAdvertise parses the --cluster-advertise daemon config which accepts <ip-address>:<port> or <interface-name>:<port>.
Register makes a discovery backend available by the provided scheme.
# Variables
ErrNotImplemented is returned when discovery feature is not implemented by discovery backend.
ErrNotSupported is returned when a discovery service is not supported.
# Type aliases
Entries is a list of *Entry with some helpers.