Skip to content

fix(docker): enable container-to-host connectivity for localhost services (e.g., Ollama)#491

Merged
mengzhuo merged 1 commit intosipeed:mainfrom
PixelTux:ollama
Feb 21, 2026
Merged

fix(docker): enable container-to-host connectivity for localhost services (e.g., Ollama)#491
mengzhuo merged 1 commit intosipeed:mainfrom
PixelTux:ollama

Conversation

@PixelTux
Copy link
Collaborator

@PixelTux PixelTux commented Feb 19, 2026

📝 Description

Fixes Docker containers unable to access Ollama when running on the host machine.

🗣️ Type of Change

  • 🐞 Bug fix (non-breaking change which fixes an issue)

🤖 AI Code Generation

  • 👨‍💻 Mostly Human-written (Human lead, AI assisted or none)

🔗 Related Issue

#466, #75

📚 Technical Context (Skip for Docs)

🧪 Test Environment

  • Hardware: PC
  • OS: Fedora 43
  • Model/Provider: Ollama (localhost)
  • Channels: -

📸 Evidence (Optional)

Screenshot From 2026-02-19 16-53-02

If Ollama is already running, it must be restarted with the correct host binding. I used:

pkill ollama
OLLAMA_HOST=0.0.0.0 ollama serve

On Fedora, Ollama must listen on 0.0.0.0 to be accessible from Docker. This is typically unnecessary on macOS or Windows.

I used whit config:

    "openai": {
      "api_key": "xxx",
      "api_base": "http://host.docker.internal:11434/v1"
    },

This setting must point to "api_base": "http://host.docker.internal:11434/v1".
An api_key must also be provided. The value itself is not important, but it cannot be empty because the client validates its presence.

☑️ Checklist

  • My code/docs follow the style of this project.
  • I have performed a self-review of my own changes.
  • [NA] I have updated the documentation accordingly.

I don’t believe this needs a docs update yet, cloud setups work as expected. This is specific to local Ollama in Docker and seems like an isolated case. It may be worth documenting once an official Ollama provider is added.

Copy link

@nikolasdehor nikolasdehor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sensible approach — commented-out extra_hosts for opt-in host networking is the standard Docker pattern for container-to-host connectivity. Helpful for Ollama/local-provider users, correctly commented out by default. LGTM.

@mengzhuo mengzhuo merged commit b3e20c7 into sipeed:main Feb 21, 2026
4 checks passed
SebastianBoehler pushed a commit to SebastianBoehler/picoclaw that referenced this pull request Feb 22, 2026
fix(docker): enable container-to-host connectivity for localhost services (e.g., Ollama)
hyperwd pushed a commit to hyperwd/picoclaw that referenced this pull request Mar 5, 2026
fix(docker): enable container-to-host connectivity for localhost services (e.g., Ollama)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants