{"id":16139423,"url":"https://github.com/networkop/libnetwork-multinet","last_synced_at":"2025-10-12T05:43:54.466Z","repository":{"id":83590183,"uuid":"123593829","full_name":"networkop/libnetwork-multinet","owner":"networkop","description":null,"archived":false,"fork":false,"pushed_at":"2018-04-29T13:47:19.000Z","size":4,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-30T03:07:39.742Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/networkop.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-03-02T15:10:36.000Z","updated_at":"2023-03-09T17:41:38.000Z","dependencies_parsed_at":"2023-07-07T21:45:39.518Z","dependency_job_id":null,"html_url":"https://github.com/networkop/libnetwork-multinet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/networkop/libnetwork-multinet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/networkop%2Flibnetwork-multinet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/networkop%2Flibnetwork-multinet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/networkop%2Flibnetwork-multinet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/networkop%2Flibnetwork-multinet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/networkop","download_url":"https://codeload.github.com/networkop/libnetwork-multinet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/networkop%2Flibnetwork-multinet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279010328,"owners_count":26084738,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2024-10-09T23:49:02.311Z","updated_at":"2025-10-12T05:43:54.449Z","avatar_url":"https://github.com/networkop.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Building a custom docker daemon with blackjack and deterministric network order\n\nDefault implementation of docker networking (libnetwork) uses heap\ndata structure to store pointers to all connected networks. This makes\nthe order in which a container is attached to its networks \n(with `docker network connect` or a similar API call)\ncompletely irrelevant as the heap `.pop()` operation reorders the \nelements in a heap tree. One potential fix is to change the `endpoints`\ndata structure to a simple array. This is what's implemented in\nthis [patch](https://github.com/docker/libnetwork/issues/2093) with\naccompanying [pull request](https://github.com/docker/libnetwork/issues/2093).\n\n\u003e Note that this patch may never get merged and may\n  deviate from libnetwork's master branch more as the time goes\n\n## Building a patched docker daemon\n\nThe below scripts implements all the steps necessary to\nbuild docker binaries from source\n\n```bash\nchmod +x ./build.sh \u0026\u0026 ./build.sh\n```\n\nThe above step can be run inside a container (helps with the cleanup)\n\n```bash\ndocker run --privileged -it centos bash\ngit clone https://github.com/networkop/libnetwork-multinet.git \u0026\u0026 cd libnetwork-multinet\nchmod +x ./build.sh \u0026\u0026 ./build.sh\n```\n\nThe resulting files can be found outside of container:\n\n```bash\n# find /var/lib/docker -name dockerd\nvar/lib/docker/overlay2/22ed554543dc9efb1bee699bcc09917bbe59f5ae42b39a1c71a5b94f4f67dbf5/diff/docker/bundles/binary-daemon/dockerd /usr/bin/dockerd\n```\n\n## Replacing the existing docker daemon with the patched one\n\n```bash\nyum install which -y\nsystemctl stop docker.service\nDOCKERD=$(which dockerd)\nmv $DOCKERD $DOCKERD-old\ncp docker/bundles/latest/binary-daemon/dockerd $DOCKERD\nsystemctl start docker.service\n```\n\nMake sure that SELinux security context on both $DOCKERD and $DOCKERD-old are the same \n\n## Testing\n\nNeed to create networks with more than 3 interfaces to\ncatch that:\n\n```bash\ndocker network create net1\ndocker network create net2\ndocker network create net3\ndocker network create net4\n\ndocker create --name test1 -it alpine sh\ndocker create --name test2 -it alpine sh\n\ndocker network connect net1 test1\ndocker network connect net2 test1\ndocker network connect net3 test1\ndocker network connect net4 test1\n\ndocker network connect net1 test2\ndocker network connect net2 test2\ndocker network connect net3 test2\ndocker network connect net4 test2\n\ndocker start test1\ndocker start test2\n```\n\nTo check the order of interfaces:\n\n```bash\ndocker exec -it test1 ip a\ndocker exec -it test2 ip a\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetworkop%2Flibnetwork-multinet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetworkop%2Flibnetwork-multinet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetworkop%2Flibnetwork-multinet/lists"}