docker image build --network refers to netwoking type #21982
Labels
area/build
Relates to Dockerfiles or docker build command
area/compose
Relates to docker-compose.yml spec or docker-compose binary
status/triage
Needs triage
Is this a docs issue?
Type of issue
Information is incorrect
Description
The
--network
parameter ofdocker build image
actually does not refer to a network, but to the networking mode for the RUN instructions during build.The semantics is not consistent in this case (and it sucks), since in
docker run
, the--network
connects the container to a network (it should be called--networking-mode
indocker build image
).In the compose docs there is an example showing how to add a custom network during the build phase (which is wrong) and doesn't explain that this parameter is actually for the networking mode (none, host, bridge):
Some references:
Location
https://docs.docker.com/reference/compose-file/build/#network
Suggestion
custom_network_1
exampleservice.build.network
being networking mode and different fromservice.network
The text was updated successfully, but these errors were encountered: