Docker build fails with network timeout on macOS

Resolved 💬 2 comments Opened Nov 19, 2025 by euroblaze Closed Nov 19, 2025

Docker build fails with network timeout on macOS

Environment

  • macOS: 15.5 (Build 24F74)
  • Docker Desktop: 28.5.2
  • Docker Compose: 2.40.3-desktop.1
  • Base Image: python:3.11-slim (Debian Trixie)

Problem

docker-compose build fails when running apt-get update with network timeout:

Err:1 http://deb.debian.org/debian trixie InRelease
  Could not connect to debian.map.fastlydns.net:80 (199.232.190.132)
  connection timed out

Diagnostics

From running containers (works ✅):

docker run --rm alpine ping 8.8.8.8           # Success
docker run --rm alpine nslookup deb.debian.org # Success (resolves to 199.232.190.132)

From host machine (works ✅):

ping deb.debian.org   # Success
curl http://deb.debian.org # Success (HTTP/1.1 200 OK)

During Docker build (fails ❌):

RUN apt-get update    # Timeout after 30 seconds

Unusual Finding

Docker bridge network has abnormal MTU:

"com.docker.network.driver.mtu": "65535"

Standard MTU should be 1500. This may cause packet fragmentation issues.

Steps to Reproduce

  1. Create Dockerfile:

``dockerfile
FROM python:3.11-slim
RUN apt-get update && apt-get install -y curl
``

  1. Build:

``bash
docker build .
``

  1. Result: Timeout connecting to deb.debian.org after 30s

Expected vs Actual

  • Expected: apt-get update succeeds (as it does on Linux hosts)
  • Actual: Connection timeout to Debian repositories

Impact

Cannot build Docker images that require installing system packages on macOS.

Workarounds Attempted

  • ❌ Added retry logic to Dockerfile
  • ❌ Attempted to configure DNS in build (read-only filesystem)
  • ❌ Used --no-cache flag

No successful workaround found.

---

Repository: https://github.com/anthropics/claude-code
Submit as: New Issue

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗