pkger
pkger copied to clipboard
Forward GPG agent instead of requiring the exported key
This would be much more elegant and would act similar to the SSH socket that got introduced in #58 . This seems like the best guide to forwarding the GPG agent.
From initial tests it did not work for me when I did the following:
# Add required option to sshd config
sudo echo "StreamLocalBindUnlink yes" >> /etc/ssh/sshd_config
sudo systemctl restart sshd
# make sure the agent is running on the host
gpg-connect-agent /bye
# start the container
docker run -it --rm -v $(gpgconf --list-dirs agent-extra-socket):/root/.gnupg/S.gpg-agent debian:10
And in the container
chmod 700 /root/.gnupg
chown root:root /root/.gnupg/S.gpg-agent
apt -y update && apt -y install gnupg2
gpg2 --list-keys
Will have to take a deeper look at this.