Skip to content

claude-code image missing openssh-client breaks SSH-format commit signing #110

Closed

Description

@gatezh

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

  1. Open any repo in the claude-code devcontainer with a host gitconfig that has
    commit.gpgsign = true and gpg.format = ssh (the common SSH-signing setup).
  2. 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 \
  sudo

openssh-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 shared base stage
    (FROM node:24-trixie-slim AS base, apt block at lines 61–70) does not
    install openssh-client.
  • Both published variants are affected, confirmed by reading the Dockerfile:
    • default (FROM base AS default, line 178) → ghcr.io/gatezh/devcontainers/claude-code:latest
    • sandbox (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 backfill openssh-client either.

Note for the sandbox variant: its firewall blocks deb.debian.org, so
openssh-client cannot be apt-get installed at runtime — it must be baked into
the base stage (same reasoning already documented for chromium in the
Dockerfile).

Related

  • Triggered in practice by VS Code's dev.containers.copyGitConfig, which carries
    commit.gpgsign=true into 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-track devcontainer.json; it belongs in the baked image.

Activity

  1. added a commit that references this issue on Jun 8, 2026
    3819277
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions