Alessandro Boch 4a04857a68 Fix bug in datapath key rotation in 1-1 NAT case 8 vuotta sitten
..
api 23ac56fdd0 Remove unnecessary string formats 8 vuotta sitten
bitseq 595246bdfb Merge pull request #1568 from likel/refactor 8 vuotta sitten
client 23ac56fdd0 Remove unnecessary string formats 8 vuotta sitten
cluster b0a7084c05 Honor user provided listen address for gossip 9 vuotta sitten
cmd d3e7ca726d proxy: clean up code (addendum to #1598) 8 vuotta sitten
config 8e2ca0471c Revert "validate network and endpoint name more strictly" 8 vuotta sitten
datastore 71fff44c0b replace individual endpoint_cnt read from store with 1 bulk read 8 vuotta sitten
discoverapi a1ed5b7be2 fix nits in comments and log 8 vuotta sitten
docs b72225a005 Merge pull request #1471 from datastream/patch-1 8 vuotta sitten
driverapi 64002895a5 Merge pull request #1604 from allencloud/fix-nits-in-comments 8 vuotta sitten
drivers 4a04857a68 Fix bug in datapath key rotation in 1-1 NAT case 8 vuotta sitten
drvregistry 595246bdfb Merge pull request #1568 from likel/refactor 8 vuotta sitten
etchosts ccabedfbe3 Fix file descriptor leaks 9 vuotta sitten
hostdiscovery 23ac56fdd0 Remove unnecessary string formats 8 vuotta sitten
idm 595246bdfb Merge pull request #1568 from likel/refactor 8 vuotta sitten
ipam 595246bdfb Merge pull request #1568 from likel/refactor 8 vuotta sitten
ipamapi 1b28c5e01d Internal interface to differentiate built-in drivers from remote 8 vuotta sitten
ipams f2f0212cab Merge pull request #1599 from mavenugo/v0.9 8 vuotta sitten
ipamutils 9f415d0cdb use grep to find a/an misuse 9 vuotta sitten
iptables 595246bdfb Merge pull request #1568 from likel/refactor 8 vuotta sitten
ipvs 6a2d86f0a9 Do not leak ipvs netlink socket 8 vuotta sitten
netlabel 7f43fd30f3 DNS support 9 vuotta sitten
netutils 23ac56fdd0 Remove unnecessary string formats 8 vuotta sitten
networkdb bb560a1f44 Generating node discovery events to the drivers from networkdb 8 vuotta sitten
ns 763f0fa1da Set a timeout on the netlink handle sockets 8 vuotta sitten
options 9f415d0cdb use grep to find a/an misuse 9 vuotta sitten
osl e94edd6d6b Ignore previous serf user events to avoid wrong fdb programming 8 vuotta sitten
portallocator a48b541da3 libnetwork support for Solaris 8 vuotta sitten
portmapper a48b541da3 libnetwork support for Solaris 8 vuotta sitten
resolvconf 53c84ac767 Fix GetNameServerAsCIDR 8 vuotta sitten
test 9054ac2b48 Provide a way for libnetwork to make use of Agent mode functionalities 9 vuotta sitten
testutils a48b541da3 libnetwork support for Solaris 8 vuotta sitten
types 8a225de00d Merge pull request #1205 from allencloud/fix-typos 9 vuotta sitten
vendor bfd1683e74 Use vndr for managing libnetwork dependencies 8 vuotta sitten
.dockerignore b67e986b75 Multi-Arch Support 9 vuotta sitten
.gitignore 21219731d3 IPAM to run consistency check over its bitmasks 9 vuotta sitten
CHANGELOG.md 22422dad64 Changelog for 0.8.0-dev.2 9 vuotta sitten
Dockerfile.build 47759a5d4b WIP: Update golang version to 1.7.1 8 vuotta sitten
LICENSE d7c688f0f6 Initial commit 10 vuotta sitten
MAINTAINERS fb4e5ff417 Chen Chun as libnetwork maintainer 9 vuotta sitten
Makefile bfd1683e74 Use vndr for managing libnetwork dependencies 8 vuotta sitten
README.md 7d7b9f2405 Add support to accepting arbitrary network ID 9 vuotta sitten
ROADMAP.md de588f950d fix typos 9 vuotta sitten
Vagrantfile 6293a1b8ca Updated vagrant box, ubuntu/vivid64 was remove from atlas.hasicorp.com 8 vuotta sitten
agent.go bb560a1f44 Generating node discovery events to the drivers from networkdb 8 vuotta sitten
agent.pb.go b54a4b5936 Add container short-id as an alias for swarm mode tasks 9 vuotta sitten
agent.proto b54a4b5936 Add container short-id as an alias for swarm mode tasks 9 vuotta sitten
circle.yml 2781cb0e1e Force go 1.7.1 in circle.yml to resolve failure to get golint 8 vuotta sitten
controller.go 9e630d61d5 Merge pull request #1631 from mavenugo/nstrict 8 vuotta sitten
default_gateway.go 1770ced6c0 Fix bug in needDefaultGW() 8 vuotta sitten
default_gateway_freebsd.go 261fedba8c Default GW support for overlay networks 8 vuotta sitten
default_gateway_linux.go 261fedba8c Default GW support for overlay networks 8 vuotta sitten
default_gateway_solaris.go 261fedba8c Default GW support for overlay networks 8 vuotta sitten
default_gateway_windows.go 261fedba8c Default GW support for overlay networks 8 vuotta sitten
drivers_experimental_linux.go 721518279a Handling the new experimental daemon flag 8 vuotta sitten
drivers_freebsd.go 721518279a Handling the new experimental daemon flag 8 vuotta sitten
drivers_ipam.go 576267bfb9 Moving IPAM initalization out of drvRegistry into libnetwork core 9 vuotta sitten
drivers_linux.go 721518279a Handling the new experimental daemon flag 8 vuotta sitten
drivers_solaris.go 721518279a Handling the new experimental daemon flag 8 vuotta sitten
drivers_windows.go 721518279a Handling the new experimental daemon flag 8 vuotta sitten
endpoint.go b6540296b0 Revert "Enable ping for service vip address" 8 vuotta sitten
endpoint_cnt.go 4999c5707d Fix endpoint cnt decline overflow 9 vuotta sitten
endpoint_info.go 2a9be357f9 Trust the endpoint state if we have a valid sandbox-id 8 vuotta sitten
endpoint_info_unix.go 261fedba8c Default GW support for overlay networks 8 vuotta sitten
endpoint_info_windows.go 261fedba8c Default GW support for overlay networks 8 vuotta sitten
error.go 8e2ca0471c Revert "validate network and endpoint name more strictly" 8 vuotta sitten
errors_test.go c70cfcb150 Provide interface to categorize errors 10 vuotta sitten
libnetwork_internal_test.go 8740d9e046 Merge pull request #1586 from sanimej/ptr 8 vuotta sitten
libnetwork_linux_test.go bc85efdb4f fix nits in comments 8 vuotta sitten
libnetwork_test.go f681e896ae Merge pull request #1531 from daehyeok/logrus_formating 8 vuotta sitten
machines 6531b0c4cd Use Docker Machine for Test Environments 9 vuotta sitten
network.go 8e2ca0471c Revert "validate network and endpoint name more strictly" 8 vuotta sitten
network_unix.go d1b012d97a Windows overlay driver support 8 vuotta sitten
network_windows.go f89d6b0073 Fixed misspelling 8 vuotta sitten
resolver.go 6f507f53e3 Fix the data model inconsistency that breaks daemon upgrade to 1.14-dev 8 vuotta sitten
resolver_unix.go 7f473c779a Refactoring logrus import and formatting 8 vuotta sitten
resolver_windows.go 61510dc222 Move the iptables setup for embedded DNS into a reexec process 9 vuotta sitten
sandbox.go 5c4fcff5bc Merge pull request #1609 from aboch/gw46 8 vuotta sitten
sandbox_dns_unix.go 6f507f53e3 Fix the data model inconsistency that breaks daemon upgrade to 1.14-dev 8 vuotta sitten
sandbox_dns_windows.go 96cc604cf1 Setup external DNS servers after daemon restart with live-restore 9 vuotta sitten
sandbox_externalkey.go ffbe62a8f7 sandbox_externalkey.go: split for cross compilation 9 vuotta sitten
sandbox_externalkey_solaris.go c7684b5ff7 Get libnetwork to build on Solaris 9 vuotta sitten
sandbox_externalkey_unix.go 32e08e7700 Moving the UDS file out of /var/lib/docker and into /run/ 9 vuotta sitten
sandbox_externalkey_windows.go 880d0ada95 Fix netns path setting from hook 9 vuotta sitten
sandbox_store.go 6f507f53e3 Fix the data model inconsistency that breaks daemon upgrade to 1.14-dev 8 vuotta sitten
sandbox_test.go 0d32a1924e Check subnet overlap when programming of sandbox interface 8 vuotta sitten
service.go 4f55b50f93 Cleanup service bindings when leaving cluster 9 vuotta sitten
service_common.go 4e69afc4f3 Make virtual service programming more robust 8 vuotta sitten
service_linux.go a02b4ef4a4 Fix service logs 8 vuotta sitten
service_unsupported.go d1b012d97a Windows overlay driver support 8 vuotta sitten
service_windows.go 4e69afc4f3 Make virtual service programming more robust 8 vuotta sitten
store.go 71fff44c0b replace individual endpoint_cnt read from store with 1 bulk read 8 vuotta sitten
store_linux_test.go a48b541da3 libnetwork support for Solaris 8 vuotta sitten
store_test.go a48b541da3 libnetwork support for Solaris 8 vuotta sitten
support.sh 02ef43380e Simple support script to gather libnetwork info 9 vuotta sitten
vendor.conf bfd1683e74 Use vndr for managing libnetwork dependencies 8 vuotta sitten
wrapmake.sh ddfa448536 Allow tests to be interrupted 10 vuotta sitten

README.md

libnetwork - networking for containers

Circle CI Coverage Status GoDoc

Libnetwork provides a native Go implementation for connecting containers

The goal of libnetwork is to deliver a robust Container Network Model that provides a consistent programming interface and the required network abstractions for applications.

Design

Please refer to the design for more information.

Using libnetwork

There are many networking solutions available to suit a broad range of use-cases. libnetwork uses a driver / plugin model to support all of these solutions while abstracting the complexity of the driver implementations by exposing a simple and consistent Network Model to users.

func main() {
	if reexec.Init() {
		return
	}

	// Select and configure the network driver
	networkType := "bridge"

	// Create a new controller instance
	driverOptions := options.Generic{}
	genericOption := make(map[string]interface{})
	genericOption[netlabel.GenericData] = driverOptions
	controller, err := libnetwork.New(config.OptionDriverConfig(networkType, genericOption))
	if err != nil {
		log.Fatalf("libnetwork.New: %s", err)
	}

	// Create a network for containers to join.
	// NewNetwork accepts Variadic optional arguments that libnetwork and Drivers can use.
	network, err := controller.NewNetwork(networkType, "network1", "")
	if err != nil {
		log.Fatalf("controller.NewNetwork: %s", err)
	}

	// For each new container: allocate IP and interfaces. The returned network
	// settings will be used for container infos (inspect and such), as well as
	// iptables rules for port publishing. This info is contained or accessible
	// from the returned endpoint.
	ep, err := network.CreateEndpoint("Endpoint1")
	if err != nil {
		log.Fatalf("network.CreateEndpoint: %s", err)
	}

	// Create the sandbox for the container.
	// NewSandbox accepts Variadic optional arguments which libnetwork can use.
	sbx, err := controller.NewSandbox("container1",
		libnetwork.OptionHostname("test"),
		libnetwork.OptionDomainname("docker.io"))
	if err != nil {
		log.Fatalf("controller.NewSandbox: %s", err)
	}

	// A sandbox can join the endpoint via the join api.
	err = ep.Join(sbx)
	if err != nil {
		log.Fatalf("ep.Join: %s", err)
	}

	// libnetwork client can check the endpoint's operational data via the Info() API
	epInfo, err := ep.DriverInfo()
	if err != nil {
		log.Fatalf("ep.DriverInfo: %s", err)
	}

	macAddress, ok := epInfo[netlabel.MacAddress]
	if !ok {
		log.Fatalf("failed to get mac address from endpoint info")
	}

	fmt.Printf("Joined endpoint %s (%s) to sandbox %s (%s)\n", ep.Name(), macAddress, sbx.ContainerID(), sbx.Key())
}

Future

Please refer to roadmap for more information.

Contributing

Want to hack on libnetwork? Docker's contributions guidelines apply.

Copyright and license

Code and documentation copyright 2015 Docker, inc. Code released under the Apache 2.0 license. Docs released under Creative commons.