GPG Docker Image (Dockerfile)
- Show version
docker run --rm -it vladgh/gpg --version
- List keys
docker run -it -v /path/to/keys/store:/root/.gnupg -e GPG_TTY=/dev/console vladgh/gpg --list-keys
- Encrypt with symmetric cipher only. This command asks for a passphrase.
docker run -it -v $(pwd):/gpg -e GPG_TTY=/dev/console vladgh/gpg --symmetric /gpg/my_file
- Generate GPG key
docker run -it -v /path/to/keys/store:/root/.gnupg -e GPG_TTY=/dev/console vladgh/gpg --full-gen-key
If the command complaints about more entropy start the following container in a new session on the same host
docker run --rm --privileged --entrypoint haveged vladgh/gpg -F
- Export public GPG key
docker run --rm -it -v /path/to/keys/store:/root/.gnupg -v $(pwd)/keys:/keys -e GPG_TTY=/dev/console vladgh/gpg --output /keys/my_key.pub --armor --export me@example.com
- Export private GPG key (KEEP SAFE)
docker run --rm -it -v /path/to/keys/store:/root/.gnupg -v $(pwd)/keys:/keys -e GPG_TTY=/dev/console vladgh/gpg --output /keys/my_rsa_key --armor --export-secret-key me@example.com