feat: ship nano + micro (non-modal editors) alongside nvim
The image shipped only nvim (EDITOR=nvim), a modal vi-style editor. Add both a classic and a modern non-modal option so users who aren't comfortable with vi keybindings have a choice: - nano (apt): ~2.8 MB installed; deps (libc6, libncursesw6, libtinfo6) already present via nvim/less/htop/tmux, so no extra packages pulled in. - micro: ~12 MB single static Go binary from GitHub releases (same pattern as bat/eza/zoxide). Desktop-style keys (Ctrl+S/Ctrl+Q), mouse, syntax highlighting. ARG MICRO_VERSION pins; defaults to latest. Combined ~15 MB (well within the smoke size threshold's ~250 MB headroom, so no threshold bump). EDITOR stays nvim; both editors are opt-in (export EDITOR=micro | nano). Uses the canonical micro-editor/micro URL because the old zyedidia/micro org rename makes /releases/latest redirect to another /latest, defeating the tag-parsing latest-resolution idiom (independently verified: old org 302s to micro-editor/micro; both arch tarballs HTTP 200; latest resolves to v2.0.15). Base-image change, so it lands on the next base-<hash> rebuild. Updates README (what's-inside tree + EDITOR note), CHANGELOG (Unreleased/Added), and smoke-test.sh (nano + micro presence checks). Ported from pi-devbox 3a59e15.
This commit is contained in:
@@ -18,6 +18,23 @@ Tags follow **independent semver** (since `v2.0.0`) — they version *this image
|
|||||||
now ignored across all repos in the container without per-repo `.gitignore`
|
now ignored across all repos in the container without per-repo `.gitignore`
|
||||||
entries. The `core.excludesFile` wiring is skipped if the user already set one.
|
entries. The `core.excludesFile` wiring is skipped if the user already set one.
|
||||||
|
|
||||||
|
- **Non-modal editors `nano` + `micro` alongside `nvim`.** The image shipped
|
||||||
|
only nvim (`EDITOR=nvim`), a modal vi-style editor. Added both a classic and
|
||||||
|
a modern non-modal option for users who don't want vi keybindings:
|
||||||
|
- **nano** (apt): ~2.8 MB installed; its deps (libc6, libncursesw6,
|
||||||
|
libtinfo6) are already present via nvim/less/htop/tmux, so no extra
|
||||||
|
packages are pulled in.
|
||||||
|
- **micro**: ~12 MB single static Go binary from GitHub releases (same
|
||||||
|
pattern as bat/eza/zoxide). Desktop-style keys (Ctrl+S/Ctrl+Q), mouse,
|
||||||
|
syntax highlighting. `ARG MICRO_VERSION` pins; defaults to latest.
|
||||||
|
|
||||||
|
Combined ~15 MB (<0.5% of the image). `EDITOR` stays `nvim`; both are opt-in
|
||||||
|
(`export EDITOR=micro | nano`). Uses the canonical `micro-editor/micro` URL
|
||||||
|
because the old `zyedidia/micro` org rename makes `/releases/latest` redirect
|
||||||
|
to another `/latest`, defeating the tag-parsing latest-resolution idiom.
|
||||||
|
Base-image change, so it lands on the next `base-<hash>` rebuild. Ported from
|
||||||
|
pi-devbox 3a59e15.
|
||||||
|
|
||||||
- **Workflow-lint guard (`.gitea/workflows/lint.yml` + `scripts/check-workflow-shell.sh`).**
|
- **Workflow-lint guard (`.gitea/workflows/lint.yml` + `scripts/check-workflow-shell.sh`).**
|
||||||
New cheap (~10s) lint workflow that runs on every push/PR (not just release
|
New cheap (~10s) lint workflow that runs on every push/PR (not just release
|
||||||
tags): a Gitea-accurate shell guard plus pinned `actionlint` + `shellcheck`.
|
tags): a Gitea-accurate shell guard plus pinned `actionlint` + `shellcheck`.
|
||||||
|
|||||||
@@ -35,6 +35,11 @@ ENV DEBIAN_FRONTEND=noninteractive
|
|||||||
# apt-get upgrade picks up any security/CVE fixes published between
|
# apt-get upgrade picks up any security/CVE fixes published between
|
||||||
# debian:trixie-slim base-image rebuilds. Paired with the index update
|
# debian:trixie-slim base-image rebuilds. Paired with the index update
|
||||||
# and the install in the same layer so we don't bloat image history.
|
# and the install in the same layer so we don't bloat image history.
|
||||||
|
# `nano` is included as a small, non-modal terminal editor for users who
|
||||||
|
# don't want vi-style modal editing — a companion to nvim and the `micro`
|
||||||
|
# binary installed further down. ~2.8 MB; its deps (libc6, libncursesw6,
|
||||||
|
# libtinfo6) are already pulled in by nvim/less/htop/tmux, so it adds no
|
||||||
|
# extra packages. EDITOR stays nvim; opt in via `export EDITOR=nano`.
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get upgrade -y --no-install-recommends && \
|
apt-get upgrade -y --no-install-recommends && \
|
||||||
apt-get install -y --no-install-recommends \
|
apt-get install -y --no-install-recommends \
|
||||||
@@ -66,6 +71,7 @@ RUN apt-get update && \
|
|||||||
rsync \
|
rsync \
|
||||||
python3-pip \
|
python3-pip \
|
||||||
python3-venv \
|
python3-venv \
|
||||||
|
nano \
|
||||||
&& ln -s /usr/bin/fdfind /usr/local/bin/fd \
|
&& ln -s /usr/bin/fdfind /usr/local/bin/fd \
|
||||||
&& apt-get clean \
|
&& apt-get clean \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
@@ -204,6 +210,33 @@ RUN ARCH=$(case "${TARGETARCH}" in amd64) echo "x86_64" ;; arm64) echo "arm64" ;
|
|||||||
ln -s /opt/nvim-linux-${ARCH}/bin/nvim /usr/local/bin/nvim && \
|
ln -s /opt/nvim-linux-${ARCH}/bin/nvim /usr/local/bin/nvim && \
|
||||||
nvim --version | head -1
|
nvim --version | head -1
|
||||||
|
|
||||||
|
# micro — modern, non-modal terminal editor. Ships alongside nvim so users
|
||||||
|
# who aren't comfortable with vi-style modal editing have a friendly option:
|
||||||
|
# desktop-style keybindings (Ctrl+S save, Ctrl+Q quit, Ctrl+C/V/X, Ctrl+Z
|
||||||
|
# undo), mouse support, and syntax highlighting out of the box. A single
|
||||||
|
# static Go binary (~12 MB) installed from GitHub releases, exactly like
|
||||||
|
# bat/eza/zoxide below. EDITOR stays nvim (see below); users opt in with
|
||||||
|
# `export EDITOR=micro` or `git config --global core.editor micro`.
|
||||||
|
#
|
||||||
|
# NOTE: upstream moved zyedidia/micro -> micro-editor/micro. The old org URL
|
||||||
|
# still 302s, but its /releases/latest redirect lands on ANOTHER /latest URL
|
||||||
|
# (the org rename), so the tag-parsing idiom below would resolve "latest"
|
||||||
|
# instead of a version. Use the canonical micro-editor/micro URL.
|
||||||
|
# Arch asset naming differs from the others: amd64 -> linux64, arm64 ->
|
||||||
|
# linux-arm64. The tarball extracts to micro-<version>/micro.
|
||||||
|
ARG MICRO_VERSION=latest
|
||||||
|
RUN ARCH=$(case "${TARGETARCH}" in amd64) echo "linux64" ;; arm64) echo "linux-arm64" ;; *) echo "linux64" ;; esac) && \
|
||||||
|
V="${MICRO_VERSION}" && \
|
||||||
|
if [ "$V" = "latest" ]; then \
|
||||||
|
V=$(curl -sI --retry 5 --retry-delay 5 --retry-all-errors "https://github.com/micro-editor/micro/releases/latest" | awk 'tolower($1)=="location:" { sub(/\r$/,"",$2); n=split($2,a,"/"); print a[n] }'); \
|
||||||
|
fi && \
|
||||||
|
V="${V#v}" && [ -n "$V" ] && \
|
||||||
|
echo "Installing micro ${V}" && \
|
||||||
|
curl -fsSL --retry 5 --retry-delay 5 --retry-all-errors "https://github.com/micro-editor/micro/releases/download/v${V}/micro-${V}-${ARCH}.tar.gz" | tar -xz -C /tmp && \
|
||||||
|
install /tmp/micro-${V}/micro /usr/local/bin/micro && \
|
||||||
|
rm -rf /tmp/micro-${V} && \
|
||||||
|
micro --version
|
||||||
|
|
||||||
# bat — syntax-highlighted cat replacement
|
# bat — syntax-highlighted cat replacement
|
||||||
ARG BAT_VERSION=latest
|
ARG BAT_VERSION=latest
|
||||||
RUN ARCH=$(case "${TARGETARCH}" in amd64) echo "x86_64" ;; arm64) echo "aarch64" ;; *) echo "x86_64" ;; esac) && \
|
RUN ARCH=$(case "${TARGETARCH}" in amd64) echo "x86_64" ;; arm64) echo "aarch64" ;; *) echo "x86_64" ;; esac) && \
|
||||||
|
|||||||
@@ -263,6 +263,11 @@ volumes:
|
|||||||
- ~/.config/nvim:/home/developer/.config/nvim:ro
|
- ~/.config/nvim:/home/developer/.config/nvim:ro
|
||||||
```
|
```
|
||||||
|
|
||||||
|
> **Not a vi person?** The image also ships two non-modal editors alongside nvim:
|
||||||
|
> **nano** (classic, minimal) and **micro** (modern — desktop-style `Ctrl+S`/`Ctrl+Q`
|
||||||
|
> keys, mouse, syntax highlighting). `EDITOR` stays `nvim`; opt in per-shell with
|
||||||
|
> `export EDITOR=nano` (or `micro`), or for git with `git config --global core.editor micro`.
|
||||||
|
|
||||||
### Python development with uv
|
### Python development with uv
|
||||||
|
|
||||||
The image includes Python 3.13 (from Debian Trixie) and [uv](https://docs.astral.sh/uv/), a fast Python package manager that replaces pip, venv, and pyenv:
|
The image includes Python 3.13 (from Debian Trixie) and [uv](https://docs.astral.sh/uv/), a fast Python package manager that replaces pip, venv, and pyenv:
|
||||||
@@ -807,7 +812,7 @@ Container (Debian trixie)
|
|||||||
├── opencode binary
|
├── opencode binary
|
||||||
├── oh-my-opencode-slim (optional — multi-agent orchestration plugin, includes Bun)
|
├── oh-my-opencode-slim (optional — multi-agent orchestration plugin, includes Bun)
|
||||||
├── AWS CLI v2 (SSO + Bedrock auth)
|
├── AWS CLI v2 (SSO + Bedrock auth)
|
||||||
├── neovim 0.12, tmux, htop, bat, eza, zoxide, uv, rustup, make, gcc, g++, rsync
|
├── neovim 0.12, nano, micro, tmux, htop, bat, eza, zoxide, uv, rustup, make, gcc, g++, rsync
|
||||||
├── git, git-crypt, age, gitleaks, ssh, ripgrep, fd, fzf, jq, curl, tree
|
├── git, git-crypt, age, gitleaks, ssh, ripgrep, fd, fzf, jq, curl, tree
|
||||||
├── Node.js (for MCP servers)
|
├── Node.js (for MCP servers)
|
||||||
├── Bun (optional — included with oh-my-opencode-slim)
|
├── Bun (optional — included with oh-my-opencode-slim)
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
#
|
#
|
||||||
# Verifies:
|
# Verifies:
|
||||||
# - Core binaries are on PATH and runnable
|
# - Core binaries are on PATH and runnable
|
||||||
|
# - non-modal editors nano + micro are present (alongside nvim)
|
||||||
# - opencode itself starts and prints a version
|
# - opencode itself starts and prints a version
|
||||||
# - Entrypoint runs cleanly as non-root after UID adjustment
|
# - Entrypoint runs cleanly as non-root after UID adjustment
|
||||||
# - Generated opencode.json has the expected shape
|
# - Generated opencode.json has the expected shape
|
||||||
@@ -118,6 +119,8 @@ run "node" "node --version"
|
|||||||
run "npm" "npm --version"
|
run "npm" "npm --version"
|
||||||
run "git" "git --version"
|
run "git" "git --version"
|
||||||
run "nvim" "nvim --version | head -1"
|
run "nvim" "nvim --version | head -1"
|
||||||
|
run "nano" "nano --version | head -1"
|
||||||
|
run "micro" "micro --version"
|
||||||
run "bat" "bat --version"
|
run "bat" "bat --version"
|
||||||
run "eza" "eza --version | head -1"
|
run "eza" "eza --version | head -1"
|
||||||
run "zoxide" "zoxide --version"
|
run "zoxide" "zoxide --version"
|
||||||
|
|||||||
Reference in New Issue
Block a user