feat(make): add image-debug target for interactive container debugging#28
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
make image-debug— builds the image then starts a detached keep-alive container (sleep infinity) namedwhygraph-debug, bind-mounting the current repo at/workspacemake image-debug-down— stops and removes the containerDEBUG_NAME ?= whygraph-debugvariable (overridable likeIMAGE)Motivation
The production shim runs each
whygraphcommand as an ephemeraldocker run --rm, which makes it impossible toexecin and poke around. This target keeps the container alive so you can open multiple shells, run commands interactively, and inspect/workspacewithout re-building.Usage
The container mirrors the real run environment: same
-v $PWD:/workspace -w /workspace --user $(id -u):$(id -g) -e HOME=/tmpflags as the production shim, so.whygraph//.codegraph/ownership and config discovery match a realwhygraphinvocation.Test plan
make image-debugbuilds successfully and prints the exec hintdocker exec -it whygraph-debug bashdrops into/workspacewith the repo mountedwhygraph versionworks inside the containermake image-debug-downremoves the container cleanlymake image-debugis idempotent (replaces stale container)make helpshows both new targets