I'm having trouble, while trying to run a docker container with a base ubuntu image.
While attempting to RUN apt-get update
, I'm getting the following error:
W: GPG error: http://ppa.launchpad.net/webupd8team/java/ubuntu trusty InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY C2518248EEA14886
E: The repository 'http://ppa.launchpad.net/webupd8team/java/ubuntu trusty InRelease' is not signed.
But when I try to add the key
like:
RUN apt-key adv --keyserver http://keyserver.ubuntu.com:80 --recv-keys C2518248EEA14886
I get the following error:
E: gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is required for this operation
So attempting to install gnupg
| gnupg1
| gnupg2
by RUN apt-get install -y gnupg1
I get the following error.
E: Package 'gnupg1' has no installation candidate
Here's my Dockerfile for reference just in case:
FROM ubuntu:latest
RUN apt-get install -y gnupg1
RUN apt-key adv --keyserver http://keyserver.ubuntu.com:80 --recv-keys C2518248EEA14886
RUN apt-get update && apt-get install -y \
gradle \
oracle-java8-installer \
oracle-java8-set-default \
unzip \
wget \
&& rm -rf /var/lib/apt/lists/*
So if I understand this correctly I need to update apt-get
to install gnupg
(or a variation) which I need to update key chain
but I can't do that unless I update apt-get
.
So is there a trick/workaround to this cyclic dependency? Or am I doing something wrong?
I'm very new to ubuntu and docker maybe I'm missing something obvious.
dpkg -l | grep gnupg
to your question. – Pilot6 Dec 3 '19 at 12:13gnupg
andgnupg2
should be installed. – Pilot6 Dec 3 '19 at 12:15Dockerfile
. Where am I supposed to add the line? – Abbas Dec 3 '19 at 12:19gnupg
variations none worked. – Abbas Dec 3 '19 at 12:19