microsoft / microsoft/vscode-remote-release
Unable to commit and sign because of GPG signing error in devcontainer
@chrmarti is already working on this.
Since Dec 15, 2025.
- Dominant language
- Dockerfile
- Stars
- 4.2k
- Forks
- 469
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 1
Description
Hello,
I'm opening this issue because I'm unable to commit and sign my commit with GPG key in devcontainer.
error: gpg failed to sign the data
fatal: failed to write commit object
On my host (Windows) I have Kleopatra (Gpg4win-4.4.1) installed and my key is visible in the GUI.
Then I have followed the step from this documentation : https://code.visualstudio.com/remote/advancedcontainers/sharing-git-credentials#_sharing-gpg-keys and add gnupg in the dockerfile of my devcontainer.
After rebuilding the devcontainer without cache I still can't use my gpg key.
In the devcontainer I see this :
# gpg --list-secret-keys
gpg: keybox '/root/.gnupg/pubring.kbx' created
gpg: /root/.gnupg/trustdb.gpg: trustdb created
# gpg --list-secret-keys
#
I also tried to run this command on the host : gpg-disable-keyboxd to restore the old format for gnupg but it's the same.
Moreover I can see this in the log in the devcontainer :
[51058 ms] Start: Run in container: gpgconf --list-dirs
[51062 ms] sysconfdir:/etc/gnupg
bindir:/usr/bin
libexecdir:/usr/lib/gnupg
libdir:/usr/lib/x86_64-linux-gnu/gnupg
datadir:/usr/share/gnupg
localedir:/usr/share/locale
socketdir:/root/.gnupg
dirmngr-socket:/root/.gnupg/S.dirmngr
agent-ssh-socket:/root/.gnupg/S.gpg-agent.ssh
agent-extra-socket:/root/.gnupg/S.gpg-agent.extra
agent-browser-socket:/root/.gnupg/S.gpg-agent.browser
agent-socket:/root/.gnupg/S.gpg-agent
homedir:/root/.gnupg
[51062 ms]
[51063 ms] Start: Run in container: ls '/root/.gnupg/private-keys-v1.d' 2>/dev/null
[51066 ms]
[51066 ms]
[51067 ms] Exit code 2
[51067 ms] Start: Run in Host: gpgconf --list-dirs
[51074 ms] sysconfdir:/etc/gnupg
bindir:/usr/bin
libexecdir:/usr/lib/gnupg
libdir:/usr/lib/x86_64-linux-gnu/gnupg
datadir:/usr/share/gnupg
localedir:/usr/share/locale
socketdir:/run/user/1000/gnupg
dirmngr-socket:/run/user/1000/gnupg/S.dirmngr
keyboxd-socket:/run/user/1000/gnupg/S.keyboxd
agent-ssh-socket:/run/user/1000/gnupg/S.gpg-agent.ssh
agent-extra-socket:/run/user/1000/gnupg/S.gpg-agent.extra
agent-browser-socket:/run/user/1000/gnupg/S.gpg-agent.browser
agent-socket:/run/user/1000/gnupg/S.gpg-agent
homedir:/home/ubuntu/.gnupg
[51074 ms]
[51078 ms] Start: Run in container: test -f '/root/.gnupg/pubring.kbx'
[51081 ms]
[51081 ms]
[51081 ms] Exit code 1
[51081 ms] Start: Run in container: test -f '/root/.gnupg/pubring.gpg'
[51083 ms]
[51083 ms]
[51083 ms] Exit code 1
[51084 ms] Start: Run in container: test -f '/root/.gnupg/trustdb.gpg'
[51086 ms]
[51086 ms]
[51086 ms] Exit code 1
[51086 ms] Start: Run in container: mkdir -p -m 700 '/root/.gnupg'
[51086 ms] gpg-agent: Socket in container (/root/.gnupg/S.gpg-agent) forwarded to wsl host (/run/user/1000/gnupg/S.gpg-agent.extra).
[52538 ms]
[52538 ms]
[52538 ms] Start: Run in container: (command -v 'docker' || command -v 'oras' || command -v 'skopeo') >/dev/null 2>&1
[52541 ms]
[52542 ms]
[52542 ms] Start: Run in Host: docker exec -i -u root 7631a3e823a46bf729134f84c8565d421c253f15d928fb1c8e59308ebeeaf197 /bin/sh
[52542 ms] userEnvProbe: loginInteractiveShell (default)
[52543 ms] Start: Run in container: test -f '/tmp/devcontainers-b7603ad0-25e6-400b-97b5-84857ac4bf7a1765803211341/env-loginInteractiveShell.json'
[52549 ms] Start: Run in container: echo ~
[52551 ms]
[52552 ms]
[52552 ms] Exit code 1
[52552 ms] userEnvProbe: not found in cache
[52552 ms] userEnvProbe shell: /bin/bash
[52555 ms] Start: Run in container: # Test for /root/.ssh/known_hosts and ssh
[52558 ms] Start: Run in Host: gpg-connect-agent updatestartuptty /bye
[52562 ms]
[52562 ms]
Here is my version of VSCode :
Version: 1.107.0 (user setup)
Commit: 618725e67565b290ba4da6fe2d29f8fa1d4e3622
Date: 2025-12-10T07:43:47.883Z
Electron: 39.2.3
ElectronBuildId: 12895514
Chromium: 142.0.7444.175
Node.js: 22.21.1
V8: 14.2.231.21-electron.0
OS: Windows_NT x64 10.0.22631
Extensions versionning :
- Remote development :
0.26.0 - Dev Containers :
v0.434.0 - Remote - SSH :
v0.122.0 - Remote - Tunnels :
v1.5.3 - WSL :
v0.104.3
Docker desktop version v4.54.0 with Use the WSL 2 based engine enabled
How can I solve this issue ?
Thank you very much for your help.
Best regards,
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.