{"id":37151904,"url":"https://github.com/rn/libnetwork","last_synced_at":"2026-01-14T17:56:23.973Z","repository":{"id":57551754,"uuid":"73909843","full_name":"rn/libnetwork","owner":"rn","description":"Docker Networking","archived":false,"fork":true,"pushed_at":"2018-07-17T20:17:10.000Z","size":14086,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-20T08:05:22.521Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"moby/libnetwork","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rn.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-11-16T10:38:17.000Z","updated_at":"2020-03-05T19:53:43.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/rn/libnetwork","commit_stats":null,"previous_names":[],"tags_count":43,"template":false,"template_full_name":null,"purl":"pkg:github/rn/libnetwork","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rn%2Flibnetwork","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rn%2Flibnetwork/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rn%2Flibnetwork/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rn%2Flibnetwork/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rn","download_url":"https://codeload.github.com/rn/libnetwork/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rn%2Flibnetwork/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28429064,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T16:38:47.836Z","status":"ssl_error","status_checked_at":"2026-01-14T16:34:59.695Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-14T17:56:23.358Z","updated_at":"2026-01-14T17:56:23.965Z","avatar_url":"https://github.com/rn.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# libnetwork - networking for containers\n\n[![Circle CI](https://circleci.com/gh/docker/libnetwork/tree/master.svg?style=svg)](https://circleci.com/gh/docker/libnetwork/tree/master) [![Coverage Status](https://coveralls.io/repos/docker/libnetwork/badge.svg)](https://coveralls.io/r/docker/libnetwork) [![GoDoc](https://godoc.org/github.com/docker/libnetwork?status.svg)](https://godoc.org/github.com/docker/libnetwork) [![Go Report Card](https://goreportcard.com/badge/github.com/docker/libnetwork)](https://goreportcard.com/report/github.com/docker/libnetwork)\n\nLibnetwork provides a native Go implementation for connecting containers\n\nThe goal of libnetwork is to deliver a robust Container Network Model that provides a consistent programming interface and the required network abstractions for applications.\n\n#### Design\nPlease refer to the [design](docs/design.md) for more information.\n\n#### Using libnetwork\n\nThere 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.\n\n\n```go\nimport (\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/docker/docker/pkg/reexec\"\n\t\"github.com/docker/libnetwork\"\n\t\"github.com/docker/libnetwork/config\"\n\t\"github.com/docker/libnetwork/netlabel\"\n\t\"github.com/docker/libnetwork/options\"\n)\n\nfunc main() {\n\tif reexec.Init() {\n\t\treturn\n\t}\n\n\t// Select and configure the network driver\n\tnetworkType := \"bridge\"\n\n\t// Create a new controller instance\n\tdriverOptions := options.Generic{}\n\tgenericOption := make(map[string]interface{})\n\tgenericOption[netlabel.GenericData] = driverOptions\n\tcontroller, err := libnetwork.New(config.OptionDriverConfig(networkType, genericOption))\n\tif err != nil {\n\t\tlog.Fatalf(\"libnetwork.New: %s\", err)\n\t}\n\n\t// Create a network for containers to join.\n\t// NewNetwork accepts Variadic optional arguments that libnetwork and Drivers can use.\n\tnetwork, err := controller.NewNetwork(networkType, \"network1\", \"\")\n\tif err != nil {\n\t\tlog.Fatalf(\"controller.NewNetwork: %s\", err)\n\t}\n\n\t// For each new container: allocate IP and interfaces. The returned network\n\t// settings will be used for container infos (inspect and such), as well as\n\t// iptables rules for port publishing. This info is contained or accessible\n\t// from the returned endpoint.\n\tep, err := network.CreateEndpoint(\"Endpoint1\")\n\tif err != nil {\n\t\tlog.Fatalf(\"network.CreateEndpoint: %s\", err)\n\t}\n\n\t// Create the sandbox for the container.\n\t// NewSandbox accepts Variadic optional arguments which libnetwork can use.\n\tsbx, err := controller.NewSandbox(\"container1\",\n\t\tlibnetwork.OptionHostname(\"test\"),\n\t\tlibnetwork.OptionDomainname(\"docker.io\"))\n\tif err != nil {\n\t\tlog.Fatalf(\"controller.NewSandbox: %s\", err)\n\t}\n\n\t// A sandbox can join the endpoint via the join api.\n\terr = ep.Join(sbx)\n\tif err != nil {\n\t\tlog.Fatalf(\"ep.Join: %s\", err)\n\t}\n\n\t// libnetwork client can check the endpoint's operational data via the Info() API\n\tepInfo, err := ep.DriverInfo()\n\tif err != nil {\n\t\tlog.Fatalf(\"ep.DriverInfo: %s\", err)\n\t}\n\n\tmacAddress, ok := epInfo[netlabel.MacAddress]\n\tif !ok {\n\t\tlog.Fatalf(\"failed to get mac address from endpoint info\")\n\t}\n\n\tfmt.Printf(\"Joined endpoint %s (%s) to sandbox %s (%s)\\n\", ep.Name(), macAddress, sbx.ContainerID(), sbx.Key())\n}\n```\n\n## Future\nPlease refer to [roadmap](ROADMAP.md) for more information.\n\n## Contributing\n\nWant to hack on libnetwork? [Docker's contributions guidelines](https://github.com/docker/docker/blob/master/CONTRIBUTING.md) apply.\n\n## Copyright and license\nCode and documentation copyright 2015 Docker, inc. Code released under the Apache 2.0 license. Docs released under Creative commons.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frn%2Flibnetwork","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frn%2Flibnetwork","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frn%2Flibnetwork/lists"}