Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker image build --network refers to netwoking type #21982

Open
1 task done
turicas opened this issue Feb 6, 2025 · 0 comments
Open
1 task done

docker image build --network refers to netwoking type #21982

turicas opened this issue Feb 6, 2025 · 0 comments
Labels
status/triage Needs triage

Comments

@turicas
Copy link

turicas commented Feb 6, 2025

Is this a docs issue?

  • My issue is about the documentation content or website

Type of issue

Information is incorrect

Description

The --network parameter of docker 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 in docker 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):

build:
  context: .
  network: custom_network_1

Some references:

Location

https://docs.docker.com/reference/compose-file/build/#network

Suggestion

  • Remove custom_network_1 example
  • Clarify regarding service.build.network being networking mode and different from service.network
@turicas turicas added the status/triage Needs triage label Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/triage Needs triage
Projects
None yet
Development

No branches or pull requests

1 participant