docker build --network host -t myapp .

Category: Docker

docker build --network host -t myapp .

Build using the host network

Lets RUN steps reach the host's network directly, bypassing BuildKit's default sandboxed networking. Needed when builds pull from private hosts only the host can see. Slower builds and weaker isolation are the trade-off.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.