Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I'm trying to install New Relic's system monitoring inside a docker container, but the apt-key add - fails with no valid OpenPGP data found.

There is the full Dockerfile:

FROM ubuntu
MAINTAINER Matej Koubik

RUN echo deb http://apt.newrelic.com/debian/ newrelic non-free >> /etc/apt/sources.list.d/newrelic.list
RUN wget -O- https://download.newrelic.com/548C16BF.gpg | apt-key add -
RUN apt-get update
RUN apt-get install newrelic-sysmond
RUN nrsysmond-config --set license_key=...
RUN /etc/init.d/newrelic-sysmond start
like image 882
Matěj Koubík Avatar asked Jan 03 '14 17:01

Matěj Koubík


People also ask

What is gpg no valid OpenPGP data found?

One of the other reasons for the “gpg: no valid OpenPGP data found” error can be the configuration problem of your machine, where the “curl” command is searching for the root CA in the wrong place. To handle the “gpg: no valid OpenPGP data found” error, in this case, you have to fix the CURL certificates path in the “.

What is gpg Key in docker?

gpg is the tool used in secure apt to sign files and check their signatures. That works if the key server is up (see issue 13555, and "Key server times out while installing docker on Ubuntu 14.04") The pool hkp://p80.pool.sks-keyservers.net is a subset of servers which are also available on port 80.11-Oct-2016.

What is gpg Key for?

GPG, or GNU Privacy Guard, is a public key cryptography implementation. This allows for the secure transmission of information between parties and can be used to verify that the origin of a message is genuine.


1 Answers

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
like image 66
johncosta Avatar answered Oct 05 '22 12:10

johncosta