From 61ac731cb8a8a864e7a91a8037e5b889e18a91c2 Mon Sep 17 00:00:00 2001 From: Dean Chen <862469039@qq.com> Date: Tue, 18 Aug 2026 08:51:35 +0500 Subject: [PATCH] docs: say build.network is a mode, not a Compose network The custom_network_1 example looked like a user-defined Compose network. build.network is the same as docker build --network (default/none/host). Signed-off-by: Dean Chen <862469039@qq.com> --- content/reference/compose-file/build.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/content/reference/compose-file/build.md b/content/reference/compose-file/build.md index 663292ca4b7b..1d49b79f0e4c 100644 --- a/content/reference/compose-file/build.md +++ b/content/reference/compose-file/build.md @@ -348,21 +348,19 @@ build: ### `network` -Set the network containers connect to for the `RUN` instructions during build. +Set the networking mode for `RUN` instructions during the build. This is +the same as [`docker build --network`](/reference/cli/docker/buildx/build/#network). +It is not a Compose network from the top-level [`networks`](networks.md) key. -```yaml -build: - context: . - network: host -``` +The value is a mode (`default`, `none`, or `host`), not a network name: ```yaml build: context: . - network: custom_network_1 + network: host ``` -Use `none` to disable networking during build: +Use `none` to disable networking during the build: ```yaml build: