This is a personal collection of opinionated templates for different kinds of Docker Compose setups to facilitate local development.
When trying to receive a key from a GPG key server, sometimes it will fail with the following error:
gpg: keyserver receive failed: Cannot assign requested address
As this is something that happens due to the availability / reliability of the key servers themselves, I opted for a workaround that keeps the key as a file and imports it from there:
-
Receive key manually.
-
Export key via
gpg --armor --export 0xKEYID > key.gpg
with
0xKEYID
being the key ID of the key you received. -
Move the key file into the Docker context of the image (Dockerfile directory or subdirectory).
-
Change Dockerfile to get those file contents and import key from there instead:
COPY key.gpg /tmp/key.gpg RUN gpg --import /tmp/key.gpg \ && rm /tmp/key.gpg
- picodexter | GitHub | picodexter.io