Provide an automated method to load GPG keys from a host machine into a Docker container for git commit signing.
VSCode's Remote - Containers extension v0.209.5
does not support GnuPG/MacGPG2 v1.x.x
original key storage format. VSCode's extension only looks for a pubring.kbx
file to copy and that is it. This means any one who has the older but still Gnupg compatible format (pubring.gpg
) will not work with the VSCode extension.
The keybox format was introduced in GnuPG 2.1 and it serves as an intermediate version which supports both the old and the new formats. However, up through GnuPG/MacGPG2 v2.2.32, libgcrypt 1.8.8
it will default to which ever format is found inside the GNUPG_HOME_DIRECTORY (~/.gnupg
). This means if you didn't completely remove the pubring.gpg
files from disk upon upgrade from the older version, then on gpg --import
, it will import the keys into pubring.gpg
. If and only if, pubring.gpg
does not exist, then a pubring.kbx
keybox file will be created.
If you have upgraded the gpg program but not re-built the ~/.gnupg/
directory from scratch, GPG maintains the old key storage format.
EASY SOLUTION: Manually export your public & private keys, backup the ~/.gnupg/
directory by moving it to ~/.gnupg_pre_2.1
, rebuild the ~/.gnupg
folder, and then run gpg --import
for key files.