moby/hack/make
Albin Kerouanton 78479b1915
libnet: Make sure network names are unique
Fixes #18864, #20648, #33561, #40901.

[This GH comment][1] makes clear network name uniqueness has never been
enforced due to the eventually consistent nature of Classic Swarm
datastores:

> there is no guaranteed way to check for duplicates across a cluster of
> docker hosts.

And this is further confirmed by other comments made by @mrjana in that
same issue, eg. [this one][2]:

> we want to adopt a schema which can pave the way in the future for a
> completely decentralized cluster of docker hosts (if scalability is
> needed).

This decentralized model is what Classic Swarm was trying to be. It's
been superseded since then by Docker Swarm, which has a centralized
control plane.

To circumvent this drawback, the `NetworkCreate` endpoint accepts a
`CheckDuplicate` flag. However it's not perfectly reliable as it won't
catch concurrent requests.

Due to this design decision, API clients like Compose have to implement
workarounds to make sure names are really unique (eg.
docker/compose#9585). And the daemon itself has seen a string of issues
due to that decision, including some that aren't fixed to this day (for
instance moby/moby#40901):

> The problem is, that if you specify a network for a container using
> the ID, it will add that network to the container but it will then
> change it to reference the network by using the name.

To summarize, this "feature" is broken, has no practical use and is a
source of pain for Docker users and API consumers. So let's just remove
it for _all_ API versions.

[1]: https://github.com/moby/moby/issues/18864#issuecomment-167201414
[2]: https://github.com/moby/moby/issues/18864#issuecomment-167202589

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2023-09-12 10:40:13 +02:00
..
.binary hack: compile w/o optimizations & inlining when debugging 2023-09-08 17:16:58 +02:00
.build-empty-images hack: Rename .ensure-emptyfs to .build-empty-images 2023-05-23 15:50:35 +02:00
.go-autogen hack: display build cmd when DOCKER_DEBUG set 2023-01-19 21:33:39 +01:00
.go-autogen.ps1 use go-winres for windows build and cleanup autogen and winresources 2022-04-14 19:52:36 +02:00
.install Fixup libnetwork lint errors 2021-06-01 23:48:32 +00:00
.integration-daemon-start hack: Add TEST_IGNORE_CGROUP_CHECK 2023-09-08 13:41:03 +02:00
.integration-daemon-stop run shfmt 2020-03-03 12:27:49 +09:00
.integration-test-helpers Wire up tests to support otel tracing 2023-09-07 18:38:22 +00:00
.mkwinres hack: remove version from binaries, and remove symlinks 2022-07-02 16:57:51 +02:00
binary Move proxy build into hack/make 2021-06-01 22:14:06 +00:00
binary-daemon hack: restore copy_binaries func 2023-01-05 13:21:28 +01:00
binary-proxy hack: do not set buildmode pie for statically linked binary 2023-01-01 18:03:02 +01:00
dynbinary Move proxy build into hack/make 2021-06-01 22:14:06 +00:00
dynbinary-daemon hack: remove unnecessary vars in make.sh script 2023-01-19 21:33:38 +01:00
dynbinary-proxy hack: remove unnecessary vars in make.sh script 2023-01-19 21:33:38 +01:00
install-binary hack: stop installing containerd-shim (io.containerd.runtime.v1.linux) 2022-06-05 18:41:44 +09:00
install-proxy Fixup libnetwork lint errors 2021-06-01 23:48:32 +00:00
README.md Remove test-unit from hack/make 2017-07-17 11:39:33 -04:00
run Disable tls when launching dockerd through hack/make.sh 2023-07-09 22:26:07 +02:00
test-docker-py libnet: Make sure network names are unique 2023-09-12 10:40:13 +02:00
test-integration Use process substitution to redirect to tee 2023-09-08 10:56:21 +02:00
test-integration-flaky run shfmt 2020-03-03 12:27:49 +09:00
test-integration-shell remove Dockerfile.e2e 2023-05-29 11:03:48 +02:00

This directory holds scripts called by make.sh in the parent directory.

Each script is named after the bundle it creates. They should not be called directly - instead, pass it as argument to make.sh, for example:

./hack/make.sh binary ubuntu

# Or to run all default bundles:
./hack/make.sh

To add a bundle:

  • Create a shell-compatible file here
  • Add it to $DEFAULT_BUNDLES in make.sh