From c40fb2111defc1c9805333b9fba6fe209bb66f73 Mon Sep 17 00:00:00 2001 From: Jet Li Date: Sat, 18 Oct 2025 18:30:46 -0700 Subject: [PATCH] fix: Add --network=host to single-arch Docker builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes network isolation issue in Docker builds where containers couldn't reach external networks (PyPI, apt repos, etc). **Problem:** - Multi-arch buildx builds use: --driver-opt network=host ✅ - Single-arch builds were missing: --network=host ❌ - Result: Docker build containers had [Errno 101] Network unreachable **Root Cause:** When docker build runs without --network=host, build containers are isolated from the host network and can't reach external services. **Solution:** Add --network=host flag to single-arch docker build command on line 131. **Testing:** This matches the configuration used successfully in multi-arch builds. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../src/com/freeleaps/devops/ImageBuilder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/first-class-pipeline/src/com/freeleaps/devops/ImageBuilder.groovy b/first-class-pipeline/src/com/freeleaps/devops/ImageBuilder.groovy index 7edc075a..092a4415 100644 --- a/first-class-pipeline/src/com/freeleaps/devops/ImageBuilder.groovy +++ b/first-class-pipeline/src/com/freeleaps/devops/ImageBuilder.groovy @@ -128,7 +128,7 @@ class ImageBuilder { architectures.each { architecture -> def archTag = architecture.split("/")[1] steps.log.info("ImageBuilder", "Building image ${registry}/${repository}/${name} with architectures: ${architectures}, tag sets to ${version}") - steps.sh "docker build -t ${registry}/${repository}/${name}:${version} --platform ${architecture} -f ${dockerfile} ${contextRoot}" + steps.sh "docker build --network=host -t ${registry}/${repository}/${name}:${version} --platform ${architecture} -f ${dockerfile} ${contextRoot}" steps.sh "docker push ${registry}/${repository}/${name}:${version}" } steps.env.BUILD_IMAGE_REGISTRY = "${registry}"