pkger icon indicating copy to clipboard operation
pkger copied to clipboard

Forward GPG agent instead of requiring the exported key

Open vv9k opened this issue 4 years ago • 0 comments

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.

vv9k avatar Jul 16 '21 13:07 vv9k