Skip to content

feat: add Docker/Podman container support and publish to GHCR - #44

Open
slmingol wants to merge 1 commit into
514-labs:mainfrom
slmingol:upstream-pr/containerize
Open

slmingol wants to merge 1 commit into
514-labs:mainfrom
slmingol:upstream-pr/containerize

Conversation

@slmingol

Copy link
Copy Markdown

Summary

  • Adds a two-stage Dockerfile (build: rust:1.88-slim, runtime: distroless/cc-debian12)
  • Adds docker-compose.yaml compatible with Docker Compose and Podman Compose
  • Adds .dockerignore to exclude target/, .git/, demo/ from build context
  • Adds .github/workflows/container.yml — builds on every PR, publishes to GHCR on main push and version tags
  • Bumps rust-version in Cargo.toml from 1.85 to 1.88 (required by hickory-resolver 0.26, hickory-proto, and ratatui 0.30)
  • Documents container usage in the README Install section

Usage

No local Rust toolchain required:

docker run -it --rm ghcr.io/514-labs/dnsglobe:edge example.com
# or
podman run -it --rm ghcr.io/514-labs/dnsglobe:edge example.com

Shell alias:

alias dnsglobe='docker run -it --rm ghcr.io/514-labs/dnsglobe:edge'
dnsglobe example.com

GHCR image tags

Trigger Tags
push to main edge
push v1.2.3 tag 1.2.3, 1.2
pull request built, not pushed

Notes

  • hickory-resolver uses plain UDP/TCP only — no native-tls, openssl, or rustls in the dependency tree. distroless/cc (glibc + libgcc) is sufficient; no ca-certificates needed.
  • stdin_open: true + tty: true in docker-compose.yaml so the ratatui TUI renders correctly in interactive sessions.
  • Multi-arch build: linux/amd64 + linux/arm64 via buildx with GHA layer cache.

Verification

docker compose build
docker compose run --rm dnsglobe example.com --once

🤖 Generated with Claude Code

Adds a two-stage Dockerfile and docker-compose.yaml so dnsglobe can be
run without a local Rust toolchain:

  docker run -it --rm ghcr.io/514-labs/dnsglobe:edge example.com

The build stage uses rust:1.88-slim (bumped from 1.85 — hickory-resolver
0.26, hickory-proto, and ratatui 0.30 all require 1.88). The runtime
stage uses distroless/cc-debian12: hickory-resolver uses plain UDP/TCP
with no TLS dependencies, so no ca-certificates or openssl is needed.

A GitHub Actions workflow (container.yml) builds on every PR and push,
publishes to ghcr.io/514-labs/dnsglobe on pushes to main (edge tag) and
on version tags (semver: v1.2.3 → 1.2.3 and 1.2). Multi-arch:
linux/amd64 + linux/arm64 with GHA layer cache.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@slmingol
slmingol force-pushed the upstream-pr/containerize branch from e3095aa to a6218a5 Compare September 21, 2026 01:55
slmingol added a commit to slmingol/dnsglobe that referenced this pull request Sep 21, 2026
Adds a second binary `dnsglobe-web` — an Axum 0.8 WebSocket server that
streams DNS propagation results as JSON to a single-file browser UI.

The UI shows a live resolver table (Resolver, Loc, IP, Ping, Status, Answer)
and a rotating D3 orthographic globe with per-resolver status dots, matching
the TUI's visual language in the browser. Domain and record type are
configurable; results stream in real-time as the 34 parallel DNS queries
resolve.

Implementation:
- `src/lib.rs`: re-exports terminal-free modules (app, dns, globe, resolvers,
  sites) as a lib crate so `dnsglobe-web` can share DNS/resolver logic without
  pulling in ratatui/crossterm
- `src/bin/web.rs`: Axum router with `/` (HTML) and `/ws` (WebSocket);
  JoinSet drives 34 concurrent hickory-resolver queries; each result streams
  immediately as JSON: {index, resolver, ip, location, status, answer, ttl,
  ping_ms, lat, lon, total}
- `src/static/index.html`: dark-themed single-file frontend; D3 7.9.0 +
  topojson-client 3 from CDN; globe auto-rotates; land features cached on
  load; progress bar tracks X/34; table updates live as results arrive
- `Cargo.toml`: adds axum 0.8 (ws feature), serde_json, tower-http 0.6
  (cors); declares `[lib]` and `[[bin]]` targets for both binaries
- `Dockerfile`: copies both binaries into the distroless runtime image
- `docker-compose.yaml`: adds `dnsglobe-web` service with port 8080 and
  PORT env var; `dnsglobe` TUI service unchanged

Usage (no local Rust toolchain required):

  docker compose up dnsglobe-web
  open http://localhost:8080

Depends on: 514-labs#44 (Docker/Podman container support)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
slmingol added a commit to slmingol/dnsglobe that referenced this pull request Sep 21, 2026
Adds a second binary `dnsglobe-web` — an Axum 0.8 WebSocket server that
streams DNS propagation results as JSON to a single-file browser UI.

The UI shows a live resolver table (Resolver, Loc, IP, Ping, Status, Answer)
and a rotating D3 orthographic globe with per-resolver status dots, matching
the TUI's visual language in the browser. Domain and record type are
configurable; results stream in real-time as the 34 parallel DNS queries
resolve. A footer shows the binary version and links to the repo.

Implementation:
- `src/lib.rs`: re-exports terminal-free modules (app, dns, globe, resolvers,
  sites) as a lib crate so `dnsglobe-web` shares DNS/resolver logic without
  pulling in ratatui/crossterm
- `src/bin/web.rs`: Axum router with `/` (HTML) and `/ws` (WebSocket);
  JoinSet drives 34 concurrent hickory-resolver queries; each result streams
  immediately as JSON; version injected via env!("CARGO_PKG_VERSION")
- `src/static/index.html`: dark-themed single-file frontend; D3 7.9.0 +
  topojson-client 3 from CDN; auto-rotating orthographic globe; live table;
  progress bar; footer with version + repo link
- `Cargo.toml`: adds axum 0.8 (ws feature), serde_json, tower-http 0.6
  (cors); declares `[lib]` and `[[bin]]` targets for both binaries
- `Dockerfile`: cargo-chef for dep caching; copies both binaries into the
  distroless runtime image; native arm64 + amd64 build via GitHub Actions
- `docker-compose.yaml`: adds `dnsglobe-web` service on port 8080;
  `dnsglobe` TUI service unchanged
- `CHANGELOG.md` / `README.md`: updated for web UI usage

Usage (no local Rust toolchain required):

  docker compose up dnsglobe-web
  open http://localhost:8080

Depends on: 514-labs#44 (Docker/Podman container support)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@callicles

Copy link
Copy Markdown
Contributor

@slmingol Why do you need this? the binary release doesn't require a local Rust toolchain

@slmingol

slmingol commented Sep 26, 2026 •

Copy link
Copy Markdown
Author

@callicles

@slmingol Why do you need this? the binary release doesn't require a local Rust toolchain

I find it easier to manage all my sprawling CLI tools with containerized versions vs. landing them directly on my systems these days. Also I did this as foundational work bc I then added a web UI version which leverages the app being a containerized app. Look at my other PR(s) involving the web UI I added to this app.

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.

2 participants