Skip to content

feat(make): add image-debug target for interactive container debugging#28

Merged
cvetty merged 1 commit into
mainfrom
feature/make-image-debug
May 31, 2026
Merged

feat(make): add image-debug target for interactive container debugging#28
cvetty merged 1 commit into
mainfrom
feature/make-image-debug

Conversation

@cvetty
Copy link
Copy Markdown
Contributor

@cvetty cvetty commented May 31, 2026

Summary

  • Adds make image-debug — builds the image then starts a detached keep-alive container (sleep infinity) named whygraph-debug, bind-mounting the current repo at /workspace
  • Adds make image-debug-down — stops and removes the container
  • Adds DEBUG_NAME ?= whygraph-debug variable (overridable like IMAGE)

Motivation

The production shim runs each whygraph command as an ephemeral docker run --rm, which makes it impossible to exec in and poke around. This target keeps the container alive so you can open multiple shells, run commands interactively, and inspect /workspace without re-building.

Usage

make image-debug                      # build + start
docker exec -it whygraph-debug bash   # drop into the container
make image-debug-down                 # tear down

The container mirrors the real run environment: same -v $PWD:/workspace -w /workspace --user $(id -u):$(id -g) -e HOME=/tmp flags as the production shim, so .whygraph/ / .codegraph/ ownership and config discovery match a real whygraph invocation.

Test plan

  • make image-debug builds successfully and prints the exec hint
  • docker exec -it whygraph-debug bash drops into /workspace with the repo mounted
  • whygraph version works inside the container
  • make image-debug-down removes the container cleanly
  • Re-running make image-debug is idempotent (replaces stale container)
  • make help shows both new targets

Adds `make image-debug` / `make image-debug-down` targets that build the
image and run a detached keep-alive container (`sleep infinity`) so
developers can `docker exec -it whygraph-debug bash` to inspect the
environment without the usual ephemeral-per-command teardown.

Mirrors the production shim flags (-v $PWD:/workspace, --user, -e HOME=/tmp)
so file ownership and config discovery match a real `whygraph` invocation.
@cvetty cvetty merged commit d8002c2 into main May 31, 2026
2 checks passed
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