Skip to content

template: persist bash history across container rebuilds - #202

Merged
nozaq merged 2 commits into
mainfrom
claude/bash-history-persistence-w8pkhc
Sep 13, 2026
Merged

nozaq merged 2 commits into
mainfrom
claude/bash-history-persistence-w8pkhc

Conversation

@nozaq

@nozaq nozaq commented Sep 12, 2026

Copy link
Copy Markdown
Member

Shell history is lost on every rebuild today, which works against rebuilding often to pick up image updates. Every template now keeps it in a named volume, the same way it keeps its toolchain caches.

Changes

Applied identically to all 13 templates:

  • mounts gains a ${devcontainerId}-bash-history volume at /home/dev/.local/state/bash, the directory the debian base image points HISTFILE into.
  • NOTES.md gains the volume in the Persistent Caches table, a shared sentence in the section intro, and a shared closing paragraph naming HISTFILE and the default it replaces. debian had no such section and gets one.
  • README.md regenerated from NOTES.md in the format release.yml produces.
  • Template version bumped by a minor, since the applied configuration changes.

Also:

  • test/_global/common.sh asserts HISTFILE and that the mounted directory is writable, so every template's smoke test covers it.
  • The repository README.md example and the mounts bullet mention the volume.

HISTFILE itself is not set here. It belongs to the image, the way terraform and opentofu set TF_PLUGIN_CACHE_DIR for the plugin cache their templates mount, so a template only adds the volume. bare-devcontainer/images#466 adds it, and is released.

Second commit: the mise bookworm proposal

The new assertion turned verify (mise, bookworm, …) red, and the cause was older than this pull request. The mise image stopped defining a bookworm variant on 2026-09-06, because mise from 2026.7.0 on needs a newer glibc than Debian 12 provides and its calendar versioning means no later release can satisfy bookworm again. The template kept bookworm in imageVariant.proposals, and the frozen image left in the registry still starts and still runs mise --version, so nothing caught it. HISTFILE is the first assertion that needs an image built after that release, so it surfaced the stale tag.

The second commit drops the proposal and says in NOTES.md why only trixie is offered and why the remaining bookworm tags should not be pinned to. Every other template's proposals were cross-checked against the build.yaml of its image; mise was the only mismatch.

Verification

The 13 devcontainer.json files were checked to parse and to carry the new mount. Each regenerated README.md diff was checked to contain only the NOTES.md change. Containers were not started here, since Docker is unavailable in this environment; CI covers that.

🤖 Generated with Claude Code

https://claude.ai/code/session_01L6orjBAZq9L5t7rV5RDmXd

@nozaq
nozaq force-pushed the claude/bash-history-persistence-w8pkhc branch from 84d955f to f90e8a1 Compare September 12, 2026 05:50
@nozaq
nozaq marked this pull request as ready for review September 13, 2026 00:34
@nozaq
nozaq force-pushed the claude/bash-history-persistence-w8pkhc branch 2 times, most recently from 1887f8f to b1a260d Compare September 13, 2026 00:38
Every template now mounts a ${devcontainerId}-bash-history volume at
/home/dev/.local/state/bash, the directory the debian base image points
HISTFILE into, so a project's shell history survives a rebuild the same way
its toolchain caches do.

The variable and the directory belong to the image, the way the terraform and
opentofu images set TF_PLUGIN_CACHE_DIR for the plugin cache their templates
mount, so the templates only add the volume. This depends on the
bare-devcontainer/images change that adds both.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6orjBAZq9L5t7rV5RDmXd
The mise image stopped defining a bookworm variant on 2026-09-06: mise from
2026.7.0 on needs a newer glibc than Debian 12 provides, and its calendar
versioning means no later release can satisfy bookworm again. The template
kept offering the tag, and the frozen image still in the registry let the
smoke test pass, so the mismatch went unnoticed until the new HISTFILE
assertion needed an image built after that release.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6orjBAZq9L5t7rV5RDmXd
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