Adding GPG key inside docker container causes "no valid OpenPGP data found" Adding GPG key inside docker container causes "no valid OpenPGP data found" docker docker

Adding GPG key inside docker container causes "no valid OpenPGP data found"


The solution provided by @xdays works around the problem, but also works around the protection that ssl is providing. You could install the ca-certificates package before issuing your wget statement and it should work with ssl.

Add the following line before your call to wget:

RUN apt-get install -y ca-certificates wget


it seems that the problem is wget, add --no-check-certificate to your wget, and everything is ok.

# wget --no-check-certificate -O- https://download.newrelic.com/548C16BF.gpg | apt-key add -                                                                 --2014-01-12 09:29:30--  https://download.newrelic.com/548C16BF.gpgResolving download.newrelic.com (download.newrelic.com)... 50.31.164.159Connecting to download.newrelic.com (download.newrelic.com)|50.31.164.159|:443... connected.WARNING: cannot verify download.newrelic.com's certificate, issued by `/C=US/O=GeoTrust, Inc./CN=GeoTrust SSL CA':  Unable to locally verify the issuer's authority.HTTP request sent, awaiting response... 200 OKLength: 1682 (1.6K) [application/octet-stream]Saving to: `STDOUT'100%[=================================================================================================================================================>] 1,682       --.-K/s   in 0s      2014-01-12 09:29:31 (15.1 MB/s) - written to stdout [1682/1682]OK


I ran into this issue when i was installing docker.

run sudo apt install apt-transport-https ca-certificates curl software-properties-common

You can refer here.

And then curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -