Skip to content

docs(docker/container): warn that host-gateway is firewalled by default on Linux - #1407

Merged
Mkassabov merged 1 commit into
mainfrom
docs/docker-container-host-gateway-caveat
Aug 29, 2026
Merged

docs(docker/container): warn that host-gateway is firewalled by default on Linux#1407
Mkassabov merged 1 commit into
mainfrom
docs/docker-container-host-gateway-caveat

Conversation

@Mkassabov

Copy link
Copy Markdown
Contributor

Follow-up to #1398. The extraHosts example it shipped teaches the version that silently fails on Linux.

extraHosts: ["host.docker.internal:host-gateway"],
DATABASE_URL: "postgres://postgres@host.docker.internal:5432/app",

host-gateway is the Docker bridge gateway (172.17.0.1), so the container's packets land on the host's INPUT chain. ufw ships DEFAULT_INPUT_POLICY="DROP", so the hostname resolves and the connection then times out — which reads as an application bug, not a firewall one. This is the same root cause as #1334; sudo ufw allow from 172.16.0.0/12 fixes it.

Adds that caveat to the Host Access section and the extraHosts field JSDoc, plus a second example, since the prop is a general hostname pin rather than a host-access knob:

extraHosts: ["payments.internal:10.1.2.3"],

Note that Cloudflare.Container under alchemy dev is unaffected — DockerLoopback.sidecarLoopbackExtraHost() deliberately maps its alias to 127.0.0.1 plus a bind-mounted unix socket on Linux, precisely to avoid the bridge IP.

Comment-only; tsc -b output is byte-identical to main.

…lt on Linux

`extraHosts: ["host.docker.internal:host-gateway"]` resolves fine on Linux and
then times out under ufw's default `DEFAULT_INPUT_POLICY="DROP"` — the bridge
gateway is a host `INPUT` destination. Document that, and add an example that
isn't about host access, since the prop is a general hostname pin.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Sz7qnfNGrjV19eTPzKNTy7
@Mkassabov
Mkassabov merged commit 820fc31 into main Aug 29, 2026
7 checks passed
@Mkassabov
Mkassabov deleted the docs/docker-container-host-gateway-caveat branch August 29, 2026 21:51
@alchemy-version-bot

Copy link
Copy Markdown
Contributor

Install the packages built from this commit:

Alchemy

alchemy

bun add https://pkg.ing/alchemy/c6c426c

@alchemy.run/better-auth

bun add https://pkg.ing/@alchemy.run/better-auth/c6c426c

@alchemy.run/cloudflare-runtime

bun add https://pkg.ing/@alchemy.run/cloudflare-runtime/c6c426c

@alchemy.run/frontend-frameworks

bun add https://pkg.ing/@alchemy.run/frontend-frameworks/c6c426c

@alchemy.run/node-utils

bun add https://pkg.ing/@alchemy.run/node-utils/c6c426c

@alchemy.run/pr-package

bun add https://pkg.ing/@alchemy.run/pr-package/c6c426c

@alchemy.run/floci

bun add https://pkg.ing/@alchemy.run/floci/c6c426c

Distilled

@distilled.cloud/core

bun add https://pkg.ing/@distilled.cloud/core/809f3d8

@distilled.cloud/aws

bun add https://pkg.ing/@distilled.cloud/aws/809f3d8

@distilled.cloud/axiom

bun add https://pkg.ing/@distilled.cloud/axiom/809f3d8

@distilled.cloud/cloudflare

bun add https://pkg.ing/@distilled.cloud/cloudflare/809f3d8

@distilled.cloud/hetzner

bun add https://pkg.ing/@distilled.cloud/hetzner/809f3d8

@distilled.cloud/neon

bun add https://pkg.ing/@distilled.cloud/neon/809f3d8

@distilled.cloud/planetscale

bun add https://pkg.ing/@distilled.cloud/planetscale/809f3d8

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.

1 participant