#102·bytebot

Linux Docker container cannot connect to host service despite correct network configuration

Author: QuarkisinprotonCreated Sep 7, 2025Updated Nov 14, 2025

## Bug Report

System Information:

  • OS: Ubuntu (Linux)
  • **Docker Version:**Docker version 28.4.0

Problem Description: A Docker container cannot establish a network connection to a service running on the host machine, even when all configurations appear correct. This prevents Bytebot from connecting to a local Ollama instance.

Evidence:

  1. Ollama service is working correctly on the host: The command curl http://localhost:11434/api/tags run directly on the host machine succeeds and returns the correct list of models.

  2. Ollama is listening on all network interfaces: The command sudo ss -tulpn | grep ollama shows that the service is listening on *:11434 (or 0.0.0.0:11434), which is correct.

  3. Connection from a Docker container fails: A definitive test using a network-troubleshooting container (nicolaka/netshoot) fails. The command curl http://172.17.0.1:11434/api/tags (where 172.17.0.1 is the host's IP on the docker0 bridge) results in a connection timeout error: curl: (28) Failed to connect to 172.17.0.1 port 11434... Could not connect to server.

Troubleshooting Steps Performed: This issue persists even after:

  • Configuring Docker's DNS in /etc/docker/daemon.json.
  • Temporarily disabling the ufw firewall.
  • Verifying all application-level configurations (.env, docker-compose.yml).
  • Attempting to use both Docker's bridge network and network_mode: host.

Conclusion: There appears to be a fundamental network block between the Docker networking stack and the host system that is preventing container-to-host communication.