Update nexus wiki content

This commit is contained in:
2026-05-03 05:42:06 +08:00
parent 90f3811b83
commit 111bc65b7b
707 changed files with 32306 additions and 7289 deletions

View File

@@ -0,0 +1,41 @@
---
title: "DockerHostNetworking"
type: concept
tags:
- "docker"
- "networking"
- "container"
sources: []
last_updated: 2026-04-20
---
## Overview
DockerHostNetworking 是 Docker 容器访问宿主机网络服务的方式。默认情况下,容器内的 `localhost` 指向容器自身而非宿主机,因此需要特殊配置才能让容器访问运行在宿主机上的服务。
## Why It Matters for Hermes Agent + Open WebUI
Open WebUI 运行在 Docker 容器中Hermes Agent API Server 运行在宿主机上(端口 8642。容器内必须通过特殊方式访问宿主机端口。
## Options
### Option 1: host.docker.internal推荐 macOS/Windows
```bash
docker run --add-host=host.docker.internal:host-gateway ...
# 访问http://host.docker.internal:8642/v1
```
### Option 2: Host NetworkingLinux
```bash
docker run --network=host ...
# 访问http://localhost:8642/v1
```
### Option 3: Docker Bridge IP
```bash
# 先查询docker inspect bridge | grep Gateway
docker run -e OPENAI_API_BASE_URL=http://172.17.0.1:8642/v1 ...
```
## See Also
- [[open-webui-hermes-agent]]