Repository navigation
Description
Summary
The claude-code base image (ghcr.io/gatezh/devcontainers/claude-code:latest,
Debian 13 trixie) ships without openssh-client, so ssh-keygen, ssh-add,
and ssh are absent. Any container whose git config uses SSH-format commit
signing (gpg.format=ssh + commit.gpgsign=true) then fails to create
commits with error: cannot run ssh-keygen: No such file or directory.
This is easy to hit because VS Code Dev Containers' dev.containers.copyGitConfig
(on by default) copies the host ~/.gitconfig — including commit.gpgsign=true
and user.signingkey — into the container. The agent side already works (VS Code
forwards SSH_AUTH_SOCK, so a host key/YubiKey is reachable); the only missing
piece is the ssh-keygen binary to drive the signature.
Reproduction
- Open any repo in the
claude-codedevcontainer with a host gitconfig that has
commit.gpgsign = trueandgpg.format = ssh(the common SSH-signing setup). - Make any commit:
$ git commit -m "anything"
error: cannot run ssh-keygen: No such file or directory
error:
fatal: failed to write commit object
Verification
# Fresh container from the image (Debian 13 trixie):
$ command -v ssh-keygen ; echo "exit=$?"
exit=1 # MISSING (so are ssh-add, ssh, gpg)
# Installing openssh-client fixes it completely:
$ sudo apt-get update -qq && sudo apt-get install -y -qq openssh-client
Setting up libfido2-1 ... # FIDO/hardware-key support included
Setting up openssh-client (1:10.0p1-...) ...
$ command -v ssh-keygen
/usr/bin/ssh-keygen
# With the agent forwarded (VS Code) + signingkey set, signing then works:
$ git commit -S --allow-empty -m "test"
$ git log -1 --format='%G?'
G # good, trusted SSH signature
Suggested fix
Add openssh-client to the shared base stage apt block in
claude-code/.devcontainer/Dockerfile (currently lines 61–70). Because both the
default and sandbox targets derive from base, adding it there fixes both
variants in one place:
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt/lists,sharing=locked \
apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
fish \
fzf \
gh \
git \
jq \
less \
openssh-client \
sudoopenssh-client pulls libfido2 as a dependency, so FIDO2/hardware-backed
signing keys (e.g. YubiKey sk-ssh-ed25519) work too. It also restores ssh and
ssh-add, which are generally useful in a dev image.
Affected files in this repo (verified)
claude-code/.devcontainer/Dockerfile— the sharedbasestage
(FROM node:24-trixie-slim AS base, apt block at lines 61–70) does not
installopenssh-client.- Both published variants are affected, confirmed by reading the Dockerfile:
default(FROM base AS default, line 178) →ghcr.io/gatezh/devcontainers/claude-code:latestsandbox(FROM base AS sandbox, line 229) →ghcr.io/gatezh/devcontainers/claude-code-sandbox:latest- The sandbox stage's own apt block (lines 238–245) adds only
iptables/ipset/iproute2/dnsutils/aggregate/chromium/fonts-freefont-ttf,
so it does not backfillopenssh-clienteither.
Note for the sandbox variant: its firewall blocks
deb.debian.org, so
openssh-clientcannot beapt-get installed at runtime — it must be baked into
thebasestage (same reasoning already documented forchromiumin the
Dockerfile).
Related
- Triggered in practice by VS Code's
dev.containers.copyGitConfig, which carries
commit.gpgsign=trueinto the container where signing can't run. - Agent forwarding itself is fine; this is purely the missing client binary.
- Downstream cannot fix this in
.devcontainer/without diverging from the
framework-trackdevcontainer.json; it belongs in the baked image.
Activity
fix(claude-code): install openssh-client for SSH-format commit signing (