Jana Radhakrishnan ab8dfb54fe Separate endpoint count data from network object преди 9 години
..
Godeps 93bc5ed4c7 Update libkv godeps преди 9 години
api bd45253fb5 move Labels from array to map to be consistent with cotnainers преди 9 години
bitseq 6026fe772c Remove 2^32 bits restriction on bitsequence преди 9 години
client 2401496d2a Enable network labels in Rest API преди 9 години
cmd 2401496d2a Enable network labels in Rest API преди 9 години
config 4543607d74 Merge pull request #602 from dhiltgen/tls преди 9 години
datastore a6c2dd75b5 Synchronize datastore apis преди 9 години
docs e412743e45 Merge pull request #574 from frntn/patch-1 преди 9 години
driverapi 71e14dd52a Remove always-on watch for networks and endpoints преди 9 години
drivers fb19b4f488 Merge pull request #629 from sanimej/slice преди 9 години
etchosts cc02894a50 Move test specific functions to a testutils package. преди 10 години
hostdiscovery 0066225da5 Integration with Docker Discovery преди 10 години
idm 6026fe772c Remove 2^32 bits restriction on bitsequence преди 9 години
ipam c2064dc18d Reduce logging verbosity in allocator преди 9 години
ipamapi ddcfab5f81 libnetwork <-> ipam driver interaction преди 9 години
ipams 2aaef377f3 IPAM driver преди 9 години
ipamutils 7391338323 Make ipamutils compile for windows преди 9 години
iptables cc02894a50 Move test specific functions to a testutils package. преди 10 години
netlabel bd45253fb5 move Labels from array to map to be consistent with cotnainers преди 9 години
netutils cc02894a50 Move test specific functions to a testutils package. преди 10 години
ns cc02894a50 Move test specific functions to a testutils package. преди 10 години
options cc02894a50 Move test specific functions to a testutils package. преди 10 години
osl caab594ffb Moved InterfaceStatistics from osl into types package преди 10 години
portallocator cc02894a50 Move test specific functions to a testutils package. преди 10 години
portmapper cc02894a50 Move test specific functions to a testutils package. преди 10 години
resolvconf e5d44569fb fix the regexp for matching an ip address преди 9 години
test 888f13d17b Make the integration tests robust преди 9 години
testutils cc02894a50 Move test specific functions to a testutils package. преди 10 години
types 02386e85d5 Enable Network labels in backend преди 9 години
.gitignore 2aaef377f3 IPAM driver преди 9 години
LICENSE d7c688f0f6 Initial commit преди 10 години
MAINTAINERS 930d27c06c Add Alessandro as a libnetwork maintainer преди 10 години
Makefile ce44f2478d Add overlay network integration test преди 10 години
README.md e82989f845 Fix outdated docs and comments преди 10 години
ROADMAP.md cc6d1be37e Update ROADMAP.md преди 10 години
circle.yml 2c797384ff Report Code Coverage and Add Status Badges преди 10 години
controller.go ab8dfb54fe Separate endpoint count data from network object преди 9 години
default_gateway.go 51699b91aa Merge pull request #560 from mavenugo/adb преди 10 години
drivers.go a226c36b75 Pass down store configs to driver преди 9 години
drivers_freebsd.go d565a4df48 Push driver config during `Init` преди 10 години
drivers_linux.go d565a4df48 Push driver config during `Init` преди 10 години
drivers_windows.go d565a4df48 Push driver config during `Init` преди 10 години
endpoint.go ab8dfb54fe Separate endpoint count data from network object преди 9 години
endpoint_cnt.go ab8dfb54fe Separate endpoint count data from network object преди 9 години
endpoint_info.go b9596c89d6 libnetwork to handle allocation of ipv6 преди 9 години
error.go 3d3bd9331f Fixed a couple of error messages to address UX related comments преди 9 години
errors_test.go c70cfcb150 Provide interface to categorize errors преди 10 години
libnetwork_internal_test.go ab8dfb54fe Separate endpoint count data from network object преди 9 години
libnetwork_test.go 6026fe772c Remove 2^32 bits restriction on bitsequence преди 9 години
network.go ab8dfb54fe Separate endpoint count data from network object преди 9 години
sandbox.go 1ffe6fef02 Move sandbox resources when container restarts преди 9 години
sandbox_externalkey.go a41025e9c0 Fixed a few more issues observed during docker integration преди 10 години
sandbox_store.go c2064dc18d Reduce logging verbosity in allocator преди 9 години
sandbox_test.go 71e14dd52a Remove always-on watch for networks and endpoints преди 9 години
store.go ab8dfb54fe Separate endpoint count data from network object преди 9 години
store_test.go 284c9cd0f5 Revert "Share libkv store handles across datastore handles" преди 9 години
wrapmake.sh ddfa448536 Allow tests to be interrupted преди 10 години

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.

NOTE: libnetwork project is under heavy development and is not ready for general use.

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.

	// 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 {
		return
	}

	// 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 {
		return
	}

	// 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 {
		return
	}

	// 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"))

	// A sandbox can join the endpoint via the join api.
	err = ep.Join(sbx)
	if err != nil {
		return
	}

	// libnetwork client can check the endpoint's operational data via the Info() API
	epInfo, err := ep.DriverInfo()
	mapData, ok := epInfo[netlabel.PortMap]
	if ok {
		portMapping, ok := mapData.([]types.PortBinding)
		if ok {
			fmt.Printf("Current port mapping for endpoint %s: %v", ep.Name(), portMapping)
		}
	}

Current Status

Please watch this space for updates on the progress.

Currently libnetwork is nothing more than an attempt to modularize the Docker platform's networking subsystem by moving it into libnetwork as a library.

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.