Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nonzero [error] code on gpg: keyserver receive failed: Cannot assign requested address

I am getting this message on building a Debian:stretch-slim Docker image with Python 3.7.7:

gpg: keyserver receive failed: Cannot assign requested address
The command '/bin/sh -c set -ex [...]'
[...] returned a non-zero code: 2

I think it's a GPG or a networking issue.

Any tips? Your assistance is highly appreciated.

like image 832
Fernando Abreu Avatar asked Oct 20 '25 11:10

Fernando Abreu


1 Answers

Following the recommendation from Laurent Sittler, the solution was on adding options to the gpg servers.

Find this line in the Dockerfile:

&& gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \

and replace it with this block:

&& ( \
  gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \
    || gpg --batch --keyserver pgp.mit.edu --recv-keys "$GPG_KEY" \
    || gpg --batch --keyserver keyserver.pgp.com --recv-keys "$GPG_KEY" \
) \
like image 197
Fernando Abreu Avatar answered Oct 22 '25 01:10

Fernando Abreu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!