I have to generate a key with gpg in my Docker image with gpg --gen-key
, but it takes too long for the key generation because of the entropy. On a local machine i can fill up my entropy with rng-tools
, but how can i implement this in my Dockerfile
?
During my research i found some solutions, but no one of them satisfied me really.
Can you share your approach of generating a key in a Dockerfile?
EDIT:
The purpose of the key generation in the Dockerfile is, that i have to download encrypted files (which is encrypted with the public key of the docker container) from a server, decrypt it and make it available on my docker container/server.
The articles, i found for this purpose:
GPG Key Generation Fails on Alpine Linux Docker Image
Decrypt with gpg from inside a docker container
Dockerize everything - run gpg inside container
Adding GPG key inside docker container causes “no valid OpenPGP data found”