Dave
Dave

Reputation: 8091

What does docker build --network host actually do?

What does the option --network host actually do indocker build --network host .? What behaves differently for having the option set vice the default?

Upvotes: 5

Views: 14609

Answers (1)

danielorn
danielorn

Reputation: 6147

The --network flag specifies which Network mode is used for the RUN commands during build.

From the documentation

Sets the networking mode for the run commands during build. Supported standard values are: bridge, host, none, and container:<name|id>. Any other value is taken as a custom network's name to which this container should connect to.

By default, docker uses the bridge network driver, which connects the containers to a network separate from the host. If you instead use host networking the network stack of the container is not isolated from the host.

Upvotes: 10

Related Questions