pax_global_header00006660000000000000000000000064142644641010014514gustar00rootroot0000000000000052 comment=0dde5c895075df6e3630e76f750a447cf63f4789 docker-libnetwork-tags-docker-20.10.21/000077500000000000000000000000001426446410100175655ustar00rootroot00000000000000docker-libnetwork-tags-docker-20.10.21/.circleci/000077500000000000000000000000001426446410100214205ustar00rootroot00000000000000docker-libnetwork-tags-docker-20.10.21/.circleci/config.yml000066400000000000000000000031041426446410100234060ustar00rootroot00000000000000version: 2 defaults: &defaults working_directory: ~/go/src/github.com/docker/libnetwork docker: # the following image is irrelevant for the build, everything is built inside a container, check the Makefile - image: 'circleci/golang:latest' environment: dockerbuildargs: . dockerargs: --privileged -e CIRCLECI jobs: builder: <<: *defaults steps: - checkout - setup_remote_docker: version: 19.03.12 reusable: true exclusive: false - run: make builder build: <<: *defaults steps: - checkout - setup_remote_docker: version: 19.03.12 reusable: true exclusive: false - run: make build check: <<: *defaults steps: - checkout - setup_remote_docker: version: 19.03.12 reusable: true exclusive: false - run: make check cross: <<: *defaults steps: - checkout - setup_remote_docker: version: 19.03.12 reusable: true exclusive: false - run: make cross unit-tests: <<: *defaults steps: - checkout - setup_remote_docker: version: 19.03.12 reusable: true exclusive: false - run: make unit-tests workflows: version: 2 ci: jobs: - builder - build: requires: - builder - check: requires: - builder - cross: requires: - builder - unit-tests: requires: - builder docker-libnetwork-tags-docker-20.10.21/.dockerignore000066400000000000000000000000471426446410100222420ustar00rootroot00000000000000.git .dockerignore Dockerfile bin tags docker-libnetwork-tags-docker-20.10.21/.gitignore000066400000000000000000000007461426446410100215640ustar00rootroot00000000000000# Compiled Object files, Static and Dynamic libs (Shared Objects) *.o *.a *.so *~ .gtm bin/ tags .DS_Store # Folders integration-tmp/ _obj _test .vagrant # Architecture specific extensions/prefixes *.[568vq] [568vq].out *.cgo1.go *.cgo2.c _cgo_defun.c _cgo_gotypes.go _cgo_export.* _testmain.go *.exe *.test *.prof cmd/dnet/dnet # Coverage *.tmp *.coverprofile # IDE files and folders .project .settings/ libnetworkbuild.created test/networkDb/testMain test/networkDb/gossipdb docker-libnetwork-tags-docker-20.10.21/CHANGELOG.md000066400000000000000000000170051426446410100214010ustar00rootroot00000000000000# Changelog ## 0.8.0-dev.2 (2016-05-07) - Fix an issue which may arise during sandbox cleanup (https://github.com/docker/libnetwork/pull/1157) - Fix cleanup logic in case of ipv6 allocation failure - Don't add /etc/hosts record if container's ip is empty (--net=none) - Fix default gw logic for internal networks - Error when updating IPv6 gateway (https://github.com/docker/libnetwork/issues/1142) - Fixes https://github.com/docker/libnetwork/issues/1113 - Fixes https://github.com/docker/libnetwork/issues/1069 - Fxies https://github.com/docker/libnetwork/issues/1117 - Increase the concurrent query rate-limit count - Changes to build libnetwork in Solaris ## 0.8.0-dev.1 (2016-04-16) - Fixes docker/docker#16964 - Added maximum egress bandwidth qos for Windows ## 0.7.0-rc.6 (2016-04-10) - Flush cached resolver socket on default gateway change ## 0.7.0-rc.5 (2016-04-08) - Persist ipam driver options - Fixes https://github.com/docker/libnetwork/issues/1087 - Use go vet from go tool - Godep update to pick up latest docker/docker packages - Validate remote driver response using docker plugins package method. ## 0.7.0-rc.4 (2016-04-06) - Fix the handling for default gateway Endpoint join/leave. ## 0.7.0-rc.3 (2016-04-05) - Revert fix for default gateway endpoint join/leave. Needs to be reworked. - Persist the network internal mode for bridge networks ## 0.7.0-rc.2 (2016-04-05) - Fixes https://github.com/docker/libnetwork/issues/1070 - Move IPAM resource initialization out of init() - Initialize overlay driver before network delete - Fix the handling for default gateway Endpoint join/lean ## 0.7.0-rc.1 (2016-03-30) - Fixes https://github.com/docker/libnetwork/issues/985 - Fixes https://github.com/docker/libnetwork/issues/945 - Log time taken to set sandbox key - Limit number of concurrent DNS queries ## 0.7.0-dev.10 (2016-03-21) - Add IPv6 service discovery (AAAA records) in embedded DNS server - Honor enableIPv6 flag in network create for the IP allocation - Avoid V6 queries in docker domain going to external nameservers ## 0.7.0-dev.9 (2016-03-18) - Support labels on networks ## 0.7.0-dev.8 (2016-03-16) - Windows driver to respect user set MAC address. - Fix possible nil pointer reference in ServeDNS() with concurrent go routines. - Fix netns path setting from hook (for containerd integration) - Clear cached udp connections on resolver Stop() - Avoid network/endpoint count inconsistences and remove stale networks after ungraceful shutdown - Fix possible endpoint count inconsistency after ungraceful shutdown - Reject a null v4 IPAM slice in exp vlan drivers - Removed experimental drivers modprobe check ## 0.7.0-dev.7 (2016-03-11) - Bumped up the minimum kernel version for ipvlan to 4.2 - Removed modprobe from macvlan/ipvlan drivers to resolve docker IT failures - Close dbus connection if firewalld is not started ## 0.7.0-dev.6 (2016-03-10) - Experimental support for macvlan and ipvlan drivers ## 0.7.0-dev.5 (2016-03-08) - Fixes https://github.com/docker/docker/issues/20847 - Fixes https://github.com/docker/docker/issues/20997 - Fixes issues unveiled by docker integ test over 0.7.0-dev.4 ## 0.7.0-dev.4 (2016-03-07) - Changed ownership of exposed ports and port-mapping options from Endpoint to Sandbox - Implement DNS RR in the Docker embedded DNS server - Fixes https://github.com/docker/libnetwork/issues/984 (multi container overlay veth leak) - Libnetwork to program container's interface MAC address - Fixed bug in iptables.Exists() logic - Fixes https://github.com/docker/docker/issues/20694 - Source external DNS queries from container namespace - Added inbuilt nil IPAM driver - Windows drivers integration fixes - Extract hostname from (hostname.domainname). Related to https://github.com/docker/docker/issues/14282 - Fixed race in sandbox statistics read - Fixes https://github.com/docker/libnetwork/issues/892 (docker start fails when ipv6.disable=1) - Fixed error message on bridge network creation conflict ## 0.7.0-dev.3 (2016-02-17) - Fixes https://github.com/docker/docker/issues/20350 - Fixes https://github.com/docker/docker/issues/20145 - Initial Windows HNS integration - Allow passing global datastore config to libnetwork after boot - Set Recursion Available bit in DNS query responses - Make sure iptables chains are recreated on firewalld reload ## 0.7.0-dev.2 (2016-02-11) - Fixes https://github.com/docker/docker/issues/20140 ## 0.7.0-dev.1 (2016-02-10) - Expose EnableIPV6 option - discoverapi refactoring - Fixed a few typos & docs update ## 0.6.1-rc2 (2016-02-09) - Fixes https://github.com/docker/docker/issues/20132 - Fixes https://github.com/docker/docker/issues/20140 - Fixes https://github.com/docker/docker/issues/20019 ## 0.6.1-rc1 (2016-02-05) - Fixes https://github.com/docker/docker/issues/20026 ## 0.6.0-rc7 (2016-02-01) - Allow inter-network connections via exposed ports ## 0.6.0-rc6 (2016-01-30) - Properly fixes https://github.com/docker/docker/issues/18814 ## 0.6.0-rc5 (2016-01-26) - Cleanup stale overlay sandboxes ## 0.6.0-rc4 (2016-01-25) - Add Endpoints() API to Sandbox interface - Fixed a race-condition in default gateway network creation ## 0.6.0-rc3 (2016-01-25) - Fixes docker/docker#19576 - Fixed embedded DNS to listen in TCP as well - Fixed a race-condition in IPAM to choose non-overlapping subnet for concurrent requests ## 0.6.0-rc2 (2016-01-21) - Fixes docker/docker#19376 - Fixes docker/docker#15819 - Fixes libnetwork/#885, Not filter v6 DNS servers from resolv.conf - Fixes docker/docker #19448, also handles the . in service and network names correctly. ## 0.6.0-rc1 (2016-01-14) - Fixes docker/docker#19404 - Fixes the ungraceful daemon restart issue in systemd with remote network plugin (https://github.com/docker/libnetwork/issues/813) ## 0.5.6 (2016-01-14) - Setup embedded DNS server correctly on container restart. Fixes docker/docker#19354 ## 0.5.5 (2016-01-14) - Allow network-scoped alias to be resolved for anonymous endpoint - Self repair corrupted IP database that could happen in 1.9.0 & 1.9.1 - Skip IPTables cleanup if --iptables=false is set. Fixes docker/docker#19063 ## 0.5.4 (2016-01-12) - Removed the isNodeAlive protection when user forces an endpoint delete ## 0.5.3 (2016-01-12) - Bridge driver supporting internal network option - Backend implementation to support "force" option to network disconnect - Fixing a regex in etchosts package to fix docker/docker#19080 ## 0.5.2 (2016-01-08) - Embedded DNS replacing /etc/hosts based Service Discovery - Container local alias and Network-scoped alias support - Backend support for internal network mode - Support for IPAM driver options - Fixes overlay veth cleanup issue : docker/docker#18814 - fixes docker/docker#19139 - disable IPv6 Duplicate Address Detection ## 0.5.1 (2015-12-07) - Allowing user to assign IP Address for containers - Fixes docker/docker#18214 - Fixes docker/docker#18380 ## 0.5.0 (2015-10-30) - Docker multi-host networking exiting experimental channel - Introduced IP Address Management and IPAM drivers - DEPRECATE service discovery from default bridge network - Introduced new network UX - Support for multiple networks in bridge driver - Local persistence with boltdb ## 0.4.0 (2015-07-24) - Introduce experimental version of Overlay driver - Introduce experimental version of network plugins - Introduce experimental version of network & service UX - Introduced experimental /etc/hosts based service discovery - Integrated with libkv - Improving test coverage - Fixed a bunch of issues with osl namespace mgmt ## 0.3.0 (2015-05-27) - Introduce CNM (Container Networking Model) - Replace docker networking with CNM & Bridge driver docker-libnetwork-tags-docker-20.10.21/Dockerfile000066400000000000000000000011101426446410100215500ustar00rootroot00000000000000ARG GO_VERSION=1.13.8 FROM golang:${GO_VERSION}-buster as dev RUN apt-get update && apt-get -y install iptables \ protobuf-compiler RUN go get -d github.com/gogo/protobuf/protoc-gen-gogo && \ cd /go/src/github.com/gogo/protobuf/protoc-gen-gogo && \ git reset --hard 30cf7ac33676b5786e78c746683f0d4cd64fa75b && \ go install RUN go get golang.org/x/lint/golint \ golang.org/x/tools/cmd/cover \ github.com/mattn/goveralls \ github.com/gordonklaus/ineffassign \ github.com/client9/misspell/cmd/misspell WORKDIR /go/src/github.com/docker/libnetwork FROM dev COPY . . docker-libnetwork-tags-docker-20.10.21/LICENSE000066400000000000000000000260751426446410100206040ustar00rootroot00000000000000Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "{}" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright {yyyy} {name of copyright owner} Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. docker-libnetwork-tags-docker-20.10.21/MAINTAINERS000066400000000000000000000023231426446410100212620ustar00rootroot00000000000000# Libnetwork maintainers file # # This file describes who runs the docker/libnetwork project and how. # This is a living document - if you see something out of date or missing, speak up! # # It is structured to be consumable by both humans and programs. # To extract its contents programmatically, use any TOML-compliant parser. # # This file is compiled into the MAINTAINERS file in docker/opensource. # [Org] [Org."Core maintainers"] people = [ "arkodg", "euanh", "fcrisciani", "mavenugo", "selansen", ] [people] # A reference list of all people associated with the project. # All other sections should refer to people by their canonical key # in the people section. # ADD YOURSELF HERE IN ALPHABETICAL ORDER [people.arkodg] Name = "Arko Dasgupta" Email = "arko.dasgupta@docker.com" GitHub = "arkodg" [people.euanh] Name = "Euan Harris" Email = "euan.harris@docker.com" GitHub = "euanh" [people.fcrisciani] Name = "Flavio Crisciani" Email = "flavio.crisciani@docker.com" GitHub = "fcrisciani" [people.mavenugo] Name = "Madhu Venugopal" Email = "madhu@docker.com" GitHub = "mavenugo" [people.selansen] Name = "Elangovan Sivanandam" Email = "elango.siva@docker.com" GitHub = "selansen" docker-libnetwork-tags-docker-20.10.21/Makefile000066400000000000000000000146331426446410100212340ustar00rootroot00000000000000.PHONY: all all-local build build-local clean cross cross-local vet lint misspell check check-local check-code check-format unit-tests protobuf protobuf-local check-protobuf SHELL=/bin/bash dockerbuildargs ?= --target dev - < Dockerfile dockerargs ?= --privileged -v $(shell pwd):/go/src/github.com/docker/libnetwork -w /go/src/github.com/docker/libnetwork build_image=libnetworkbuild container_env = -e "INSIDECONTAINER=-incontainer=true" docker = docker run --rm -it --init ${dockerargs} $$EXTRA_ARGS ${container_env} ${build_image} CROSS_PLATFORMS = linux/amd64 linux/386 linux/arm windows/amd64 PACKAGES=$(shell go list ./... | grep -v /vendor/) PROTOC_FLAGS=-I=. -I=/go/src -I=/go/src/github.com/gogo/protobuf -I=/go/src/github.com/gogo/protobuf/protobuf export PATH := $(CURDIR)/bin:$(PATH) # Several targets in this Makefile expect to run within the # libnetworkbuild container. In general, a target named '-local' # relies on utilities inside the build container. Usually there is also # a wrapper called '' which starts a container and runs # 'make -local' inside it. ########################################################################### # Top level targets ########################################################################### all: build check clean all-local: build-local check-local clean ########################################################################### # Build targets ########################################################################### # builder builds the libnetworkbuild container. All wrapper targets # must depend on this to ensure that the container exists. builder: DOCKER_BUILDKIT=1 docker build --progress=plain -t ${build_image} --build-arg=GO_VERSION ${dockerbuildargs} build: builder @echo "๐Ÿณ $@" @${docker} make build-local build-local: @echo "๐Ÿณ $@" @mkdir -p "bin" go build -tags experimental -o "bin/dnet" ./cmd/dnet go build -o "bin/docker-proxy" ./cmd/proxy CGO_ENABLED=0 go build -o "bin/diagnosticClient" ./cmd/diagnostic CGO_ENABLED=0 go build -o "bin/testMain" ./cmd/networkdb-test/testMain.go build-images: @echo "๐Ÿณ $@" cp cmd/diagnostic/daemon.json ./bin DOCKER_BUILDKIT=1 docker build --progress=plain -f cmd/diagnostic/Dockerfile.client -t dockereng/network-diagnostic:onlyclient bin/ DOCKER_BUILDKIT=1 docker build --progress=plain -f cmd/diagnostic/Dockerfile.dind -t dockereng/network-diagnostic:17.12-dind bin/ DOCKER_BUILDKIT=1 docker build --progress=plain -f cmd/networkdb-test/Dockerfile -t dockereng/e2e-networkdb:master bin/ DOCKER_BUILDKIT=1 docker build --progress=plain -t dockereng/network-diagnostic:support.sh support/ push-images: build-images @echo "๐Ÿณ $@" docker push dockereng/network-diagnostic:onlyclient docker push dockereng/network-diagnostic:17.12-dind docker push dockereng/e2e-networkdb:master docker push dockereng/network-diagnostic:support.sh clean: @echo "๐Ÿณ $@" @if [ -d bin ]; then \ echo "Removing binaries"; \ rm -rf bin; \ fi cross: builder @mkdir -p "bin" @for platform in ${CROSS_PLATFORMS}; do \ EXTRA_ARGS="-e GOOS=$${platform%/*} -e GOARCH=$${platform##*/}" ; \ echo "$${platform}..." ; \ ${docker} make cross-local ; \ done cross-local: @echo "๐Ÿณ $@" go build -o "bin/dnet-$$GOOS-$$GOARCH" ./cmd/dnet go build -o "bin/docker-proxy-$$GOOS-$$GOARCH" ./cmd/proxy # Rebuild protocol buffers. # These may need to be rebuilt after vendoring updates, so .proto files are declared .PHONY so they are always rebuilt. PROTO_FILES=$(shell find . -path ./vendor -prune -o -name \*.proto -print) PB_FILES=$(PROTO_FILES:.proto=.pb.go) # Pattern rule for protoc. If PROTOC_CHECK is defined, it checks # whether the generated files are up to date and fails if they are not %.pb.go: %.proto @if [ ${PROTOC_CHECK} ]; then \ protoc ${PROTOC_FLAGS} --gogo_out=/tmp $< ; \ diff -q $@ /tmp/$@ >/dev/null || (echo "๐Ÿ‘น $@ is out of date; please run 'make protobuf' and check in updates" && exit 1) ; \ else \ protoc ${PROTOC_FLAGS} --gogo_out=./ $< ; \ fi .PHONY: $(PROTO_FILES) protobuf: builder @${docker} make protobuf-local protobuf-local: $(PB_FILES) ########################################################################### # Test targets ########################################################################### check: builder @${docker} make check-local check-local: check-code check-format check-code: check-protobuf lint vet ineffassign check-format: fmt misspell unit-tests: builder ${docker} make unit-tests-local unit-tests-local: @echo "๐Ÿณ Running tests... " @echo "mode: count" > coverage.coverprofile @go build -o "bin/docker-proxy" ./cmd/proxy @for dir in $$( find . -maxdepth 10 -not -path './.git*' -not -path '*/_*' -not -path './vendor/*' -type d); do \ if ls $$dir/*.go &> /dev/null; then \ pushd . &> /dev/null ; \ cd $$dir ; \ go test ${INSIDECONTAINER} -test.parallel 5 -test.v -covermode=count -coverprofile=./profile.tmp ; \ ret=$$? ;\ if [ $$ret -ne 0 ]; then exit $$ret; fi ;\ popd &> /dev/null; \ if [ -f $$dir/profile.tmp ]; then \ cat $$dir/profile.tmp | tail -n +2 >> coverage.coverprofile ; \ rm $$dir/profile.tmp ; \ fi ; \ fi ; \ done @echo "Done running tests" # Depends on binaries because vet will silently fail if it can not load compiled imports vet: ## run go vet @echo "๐Ÿณ $@" @test -z "$$(go vet ${PACKAGES} 2>&1 | grep -v 'constant [0-9]* not a string in call to Errorf' | egrep -v '(timestamp_test.go|duration_test.go|exit status 1)' | tee /dev/stderr)" misspell: @echo "๐Ÿณ $@" @test -z "$$(find . -type f | grep -v vendor/ | grep "\.go\|\.md" | xargs misspell -error | tee /dev/stderr)" fmt: ## run go fmt @echo "๐Ÿณ $@" @test -z "$$(gofmt -s -l . | grep -v vendor/ | grep -v ".pb.go$$" | tee /dev/stderr)" || \ (echo "๐Ÿ‘น please format Go code with 'gofmt -s -w'" && false) lint: ## run go lint @echo "๐Ÿณ $@" @test -z "$$(golint ./... | grep -v vendor/ | grep -v ".pb.go:" | grep -v ".mock.go" | tee /dev/stderr)" ineffassign: ## run ineffassign @echo "๐Ÿณ $@" @test -z "$$(ineffassign . | grep -v vendor/ | grep -v ".pb.go:" | grep -v ".mock.go" | tee /dev/stderr)" # check-protobuf rebuilds .pb.go files and fails if they have changed check-protobuf: PROTOC_CHECK=1 check-protobuf: $(PB_FILES) @echo "๐Ÿณ $@" ########################################################################### # Utility targets ########################################################################### shell: builder @${docker} ${SHELL} docker-libnetwork-tags-docker-20.10.21/README.md000066400000000000000000000071411426446410100210470ustar00rootroot00000000000000# libnetwork - networking for containers [![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) 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](docs/design.md) 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. ```go import ( "fmt" "log" "github.com/docker/docker/pkg/reexec" "github.com/docker/libnetwork" "github.com/docker/libnetwork/config" "github.com/docker/libnetwork/netlabel" "github.com/docker/libnetwork/options" ) 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()) } ``` ## Contributing Want to hack on libnetwork? [Docker's contributions guidelines](https://github.com/docker/docker/blob/master/CONTRIBUTING.md) apply. ## Copyright and license Code and documentation copyright 2015 Docker, inc. Code released under the Apache 2.0 license. Docs released under Creative commons. docker-libnetwork-tags-docker-20.10.21/Vagrantfile000066400000000000000000000035431426446410100217570ustar00rootroot00000000000000# -*- mode: ruby -*- # vi: set ft=ruby : # Vagrantfile API/syntax version. Don't touch unless you know what you're doing! VAGRANTFILE_API_VERSION = "2" $consul=<