Skip to content

feat: standalone Docker build for duckpipe-daemon#25

Merged
YuweiXiao merged 7 commits intomainfrom
worktree-docker-daemon
Mar 13, 2026
Merged

feat: standalone Docker build for duckpipe-daemon#25
YuweiXiao merged 7 commits intomainfrom
worktree-docker-daemon

Conversation

@YuweiXiao
Copy link
Collaborator

@YuweiXiao YuweiXiao commented Mar 13, 2026

Summary

  • Add Dockerfile.daemon — lightweight multi-stage build (builder compiles against pg_ducklake's libduckdb, runtime is debian:bookworm-slim with non-root duckpipe user)
  • Add --api-bind CLI arg (default 127.0.0.1) so containers can bind to 0.0.0.0
  • Support CONNSTR env var for --connstr via clap env attribute for cleaner Docker Compose usage
  • Parameterize docker/fetch-ducklake-ext.sh with DUCKDB_HOME env var so it works for both PG and daemon images
  • Add duckpipe_daemon / duckpipe_daemon_18 targets to docker-bake.hcl
  • Add docker_build_daemon + docker_merge_daemon CI jobs (multi-arch amd64/arm64, publishes to pgducklake/duckpipe-daemon)
  • Add docker-compose.daemon.yml example: PG db + standalone daemon with healthcheck
  • Exclude benchmark/ and .claude/ from .dockerignore

Test plan

  • docker build -f Dockerfile.daemon -t duckpipe-daemon . builds successfully
  • docker run --rm duckpipe-daemon --help shows CLI help with --api-bind and --connstr / CONNSTR
  • docker compose -f docker-compose.daemon.yml up -d starts both services
  • curl localhost:8080/health returns healthy from the daemon container
  • Existing Dockerfile build is unaffected (fetch-ducklake-ext.sh defaults unchanged)
  • CI workflow triggers on Dockerfile.daemon changes and builds both image types in parallel

🤖 Generated with Claude Code

YuweiXiao and others added 2 commits March 13, 2026 10:06
Add a lightweight daemon-only Docker image (Dockerfile.daemon) so the
daemon can be deployed independently from PostgreSQL. Includes CI to
build multi-arch images and publish to pgducklake/duckpipe-daemon.

- Add --api-bind CLI arg (default 127.0.0.1) for container use
- Support CONNSTR env var for --connstr via clap env attribute
- Parameterize fetch-ducklake-ext.sh with DUCKDB_HOME for reuse
- Add duckpipe_daemon targets to docker-bake.hcl
- Add daemon build+merge jobs to CI workflow
- Add docker-compose.daemon.yml example deployment
- Exclude benchmark/ and .claude/ from Docker build context

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove clang/libclang-dev from daemon builder (only needed by pgrx)
- Split extension download into separate ext-fetcher stage so BuildKit
  can run it in parallel with cargo build
- Merge two extension COPY layers into one (consolidated in ext-fetcher)
- Type api_bind as IpAddr instead of String for parse-time validation
- Enable clap "env" feature for CONNSTR env var support
- Remove unnecessary docker pull moby/buildkit from daemon CI job

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@YuweiXiao YuweiXiao force-pushed the worktree-docker-daemon branch from aad1c2c to 0945b1f Compare March 13, 2026 02:07
YuweiXiao and others added 5 commits March 13, 2026 10:28
The daemon runs a standalone DuckDB instance (not pg_duckdb), so it
needs both ducklake and postgres_scanner as separate .duckdb_extension
files.  Add FETCH_POSTGRES_SCANNER flag to fetch-ducklake-ext.sh —
the PG image skips it (pg_duckdb bundles its own), the daemon image
enables it (upstream version is safe outside PG backends).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
libduckdb.so dynamically links against libcurl for HTTP operations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PG 18 changed the data directory layout to use major-version-specific
subdirectories.  The mount must be at /var/lib/postgresql, not
/var/lib/postgresql/data.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…SION dependency

- Move Dockerfile, Dockerfile.daemon, docker-bake.hcl, and compose files
  into docker/ for cleaner root directory
- Remove PG_VERSION matrix from daemon CI (daemon is PG-agnostic)
- Use internal _BUILDER_PG ARG in Dockerfile.daemon to consolidate the
  hardcoded PG version into a single-line default
- Narrow CI path trigger to avoid rebuilds on compose-only changes
- Fix mixed comment style in docker-bake.hcl

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Move _BUILDER_PG ARG to top of Dockerfile.daemon (Docker requires
  global ARGs before the first FROM instruction)
- Add file: docker/Dockerfile to both build steps in ci.yaml since
  the Dockerfile moved from root to docker/

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@YuweiXiao YuweiXiao merged commit 3372077 into main Mar 13, 2026
9 checks passed
@YuweiXiao YuweiXiao deleted the worktree-docker-daemon branch March 13, 2026 05:22
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