Add rlwrap installation to orchard#20
Open
tomascasas wants to merge 6 commits into
Open
Conversation
This is helpful to run orchard on kspecs or management-kspecs so that you pull in additional folder mappings. In my case I have an orchardw.sh script in management-kspecs that I plan submitting to kspecs that will trigger orchard accepting relative/absolute paths with -r flag each and mount them to workspace/repost/<basename> upon running orchard.
Creates a named Docker volume (orchard-claude-<basename>-<hash>) for each project directory and mounts it to /home/orchard/.claude, so Claude Code chat history and settings survive container restarts and stay compartmentalized per project. Also pre-creates the ~/.claude directory in the Dockerfile so the volume mount lands with correct ownership.
Docker initializes named volume mount points as root:root, preventing the orchard user from writing to ~/.claude. Run a one-time chown after volume creation so the user can write without elevated capabilities.
Pass ORCHARD_PROJECT (basename of PROJECT_DIR) into the container and use PROMPT_COMMAND to set PS1 so the project name is visible in every prompt. PROMPT_COMMAND is used instead of PS1 directly because Ubuntu's ~/.bashrc resets PS1 on startup, but PROMPT_COMMAND runs after and wins.
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.
Fix image rebuild detection and add extra mount support
Summary
NEEDS_BUILDalways being true — the previous-nttest compared the Dockerfile path against a Docker timestamp string (not a file), so bash always evaluated the right operand as non-existent and triggered a rebuild unconditionally. Replaced with a numeric epoch comparison usingstat -f %mfor the Dockerfile anddate -j -ffor the image creation time, with suffix stripping (%%[.Z]*) to handle Docker timestamps both with and without fractional seconds.ORCHARD_EXTRA_MOUNTSsupport — callers (e.g.orchardw.sh) can now inject additional bind mounts by settingORCHARD_EXTRA_MOUNTSto a newline-separated list ofhost:containerpath pairs before invokingorchard.sh. Each valid host directory is forwarded as a-vflag todocker run.rlwrapto the image — installed alongside the other apt packages inDockerfile.orchardfor readline support inside the container.Test plan
orchard.shwith the image already up to date — confirm it prints "Using existing orchard" without rebuildingDockerfile.orchardand re-run — confirm it rebuildsorchardw.sh -r /some/repo— confirm/workspace/repos/repois accessible inside the containerrlwrapis available inside a fresh container (rlwrap --version)