-1

I'm trying to get GPG to work in my dev container (default python container) under Windows WSL2 for signed commits and getting error when trying to reload gpg agent.

Following official guide:

  1. Installed gpg4win on Windows
  2. Connected to Dev Container and added pinentry-program /mnt/c/Program\ Files\ \(x86\)/Gpg4win/bin/pinentry.exe to ~/.gnupg/gpg-agent.conf file

And when I'm trying to reload gpg agent using command gpg-connect-agent reloadagent /bye I'm getting:

gpg-connect-agent: no running gpg-agent - starting '/usr/bin/gpg-agent'
gpg-connect-agent: failed to create temporary file '/root/.gnupg/.#lk0x000055a2a31ddd90.aae1d09ea764.617': No such file or directory
gpg-connect-agent: can't connect to the agent: No such file or directory
gpg-connect-agent: error sending standard options: No agent running

Tried these solutions and none of them worked:

  1. Integration of GPG-signed Git commits in VSCode Dev Container (WSL2 Ubuntu v20)
  2. https://www.39digits.com/signed-git-commits-on-wsl2-using-visual-studio-code
cyberia
  • 1
  • 1

1 Answers1

0

Found a workaround by just mounting my local .gnupg folder to the dev container using devcontainer config file .devcontainer/devcontainer.json

"mounts": [
  "source=${localEnv:USERPROFILE}/.gnupg,target=/home/vscode/.gnupg,type=bind"
],
"remoteUser": "vscode"
cyberia
  • 1
  • 1