Ship shell defaults via /etc/skel-devbox so user files are preserved
Previous behaviour (e4063b5) COPY'd .bash_aliases and .inputrc
directly into /home/developer/ during image build. That silently
shadowed any host bind-mount or in-container customization for users
upgrading from v1.14.19b — if you'd written your own .bash_aliases
and rebuilt the container, our baked version would overwrite it
without warning.
Ship the files to /etc/skel-devbox/ instead. The entrypoint copies
them to $HOME only if the target file does not already exist, so:
- Fresh containers get the defaults automatically (unchanged)
- Host bind-mounts win (they materialize before the entrypoint runs)
- Existing in-container customizations survive upgrades
- Defaults remain discoverable at /etc/skel-devbox/ for anyone who
wants to copy, diff, or reset back to upstream
Docs (README.md, DOCKER_HUB.md, deploy/README.md) describe the new
skel layout and the restore/diff commands.
This commit is contained in:
+9
-5
@@ -205,13 +205,17 @@ RUN mkdir -p /workspace \
|
||||
chown -R ${USER_NAME}:${USER_NAME} /workspace /home/${USER_NAME}
|
||||
|
||||
# ── Shell defaults (bash history, aliases, readline) ─────────────────
|
||||
# Baked into the image so a fresh container has sensible history and
|
||||
# readline behaviour out of the box. Users can override by bind-mounting
|
||||
# their host ~/.inputrc or ~/.bash_aliases via docker-compose.yml.
|
||||
# Shipped under /etc/skel-devbox/ rather than copied directly to the
|
||||
# user's home. The entrypoint copies them to /home/developer/ only if
|
||||
# the target file does not already exist, so host bind-mounts and
|
||||
# previously-customized files are never overwritten. Users can restore
|
||||
# the baked defaults anytime via:
|
||||
# cp /etc/skel-devbox/.bash_aliases ~/.bash_aliases
|
||||
# History itself persists via the devbox-shell-history named volume
|
||||
# mounted at ~/.cache/bash (HISTFILE points there).
|
||||
COPY --chown=${USER_UID}:${USER_GID} rootfs/home/developer/.bash_aliases /home/${USER_NAME}/.bash_aliases
|
||||
COPY --chown=${USER_UID}:${USER_GID} rootfs/home/developer/.inputrc /home/${USER_NAME}/.inputrc
|
||||
RUN mkdir -p /etc/skel-devbox
|
||||
COPY rootfs/home/developer/.bash_aliases /etc/skel-devbox/.bash_aliases
|
||||
COPY rootfs/home/developer/.inputrc /etc/skel-devbox/.inputrc
|
||||
|
||||
# ── Entrypoint ────────────────────────────────────────────────────────
|
||||
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
||||
|
||||
Reference in New Issue
Block a user