moby/cmd/dockerd
Sebastiaan van Stijn b8cc2e8c66
fix "host-gateway-ip" label not set for builder workers
Commit 21e50b89c9 added a label on the buildkit
worker to advertise the host-gateway-ip. This option can be either set by the
user in the daemon config, or otherwise defaults to the gateway-ip.

If no value is set by the user, discovery of the gateway-ip happens when
initializing the network-controller (`NewDaemon`, `daemon.restore()`).

However d222bf097c changed how we handle the
daemon config. As a result, the `cli.Config` used when initializing the
builder only holds configuration information form the daemon config
(user-specified or defaults), but is not updated with information set
by `NewDaemon`.

This patch adds an accessor on the daemon to get the current daemon config.
An alternative could be to return the config by `NewDaemon` (which should
likely be a _copy_ of the config).

Before this patch:

    docker buildx inspect default
    Name:   default
    Driver: docker

    Nodes:
    Name:      default
    Endpoint:  default
    Status:    running
    Buildkit:  v0.12.4+3b6880d2a00f
    Platforms: linux/arm64, linux/amd64, linux/amd64/v2, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6
    Labels:
     org.mobyproject.buildkit.worker.moby.host-gateway-ip: <nil>

After this patch:

    docker buildx inspect default
    Name:   default
    Driver: docker

    Nodes:
    Name:      default
    Endpoint:  default
    Status:    running
    Buildkit:  v0.12.4+3b6880d2a00f
    Platforms: linux/arm64, linux/amd64, linux/amd64/v2, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6
    Labels:
     org.mobyproject.buildkit.worker.moby.host-gateway-ip: 172.18.0.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 00c9785e2e)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-01-23 15:59:09 +01:00
..
trap migrate to github.com/containerd/log v0.1.0 2023-10-11 17:52:23 +02:00
cobra.go cmd/dockerd: make cobra templates a const 2023-11-30 13:40:15 +01:00
config.go daemon/config: change DNSConfig.DNS to a []net.IP 2023-11-13 12:22:51 +01:00
config_unix.go remove pre-go1.17 build-tags 2023-05-19 20:38:51 +02:00
config_unix_test.go remove pre-go1.17 build-tags 2023-05-19 20:38:51 +02:00
config_windows.go daemon/config: New(): initialize config with platform-specific defaults 2022-08-17 08:54:32 +02:00
daemon.go fix "host-gateway-ip" label not set for builder workers 2024-01-23 15:59:09 +01:00
daemon_freebsd.go daemon: move check for CPU-realtime daemon options 2022-03-03 19:50:27 +01:00
daemon_linux.go vendor: github.com/containerd/cgroups/v3 v3.0.1 2023-03-08 20:15:17 +09:00
daemon_linux_test.go cmd/dockerd: gracefully shut down the API server 2023-04-26 10:57:28 -04:00
daemon_test.go cdi: use separate feature-flag 2024-01-17 11:31:37 +01:00
daemon_unix.go migrate to github.com/containerd/log v0.1.0 2023-10-11 17:52:23 +02:00
daemon_unix_test.go remove pre-go1.17 build-tags 2023-05-19 20:38:51 +02:00
daemon_windows.go migrate to github.com/containerd/log v0.1.0 2023-10-11 17:52:23 +02:00
docker.go daemon/config: setPlatformDefaults: use debug for missing userland-proxy 2024-01-09 13:18:04 +01:00
docker_unix.go migrate to github.com/containerd/log v0.1.0 2023-10-11 17:52:23 +02:00
docker_windows.go migrate to github.com/containerd/log v0.1.0 2023-10-11 17:52:23 +02:00
error.go cli: move cobra customizations into cmd/dockerd 2022-12-14 11:37:51 +01:00
genwinres_windows.go use go-winres for cross to create Windows resources 2022-04-14 19:52:35 +02:00
grpclog.go migrate to github.com/containerd/log v0.1.0 2023-10-11 17:52:23 +02:00
main_linux_test.go Fix listener parsering regression when no addr set 2023-03-09 23:53:05 +00:00
metrics.go migrate to github.com/containerd/log v0.1.0 2023-10-11 17:52:23 +02:00
options.go migrate to github.com/containerd/log v0.1.0 2023-10-11 17:52:23 +02:00
options_test.go cli: remove cli/config package, integrate into cmd/dockerd 2022-12-14 12:52:40 +01:00
README.md Fix readme doc for dockerd 2016-09-01 14:47:51 +08:00
required.go cli: move cobra customizations into cmd/dockerd 2022-12-14 11:37:51 +01:00
service_unsupported.go remove pre-go1.17 build-tags 2023-05-19 20:38:51 +02:00
service_windows.go migrate to github.com/containerd/log v0.1.0 2023-10-11 17:52:23 +02:00

docker.go contains Docker daemon's main function.

This file provides first line CLI argument parsing and environment variable setting.