In my Jenkins pipeline, I am trying to run a build using the Docker image maven:3.5.4-jdk-10-slim as my Jenkins agent. Inside it, I run the command apt-get update. However, when I do, I get the following error:
Get:1 http://deb.debian.org/debian sid InRelease [165 kB]
Err:1 http://deb.debian.org/debian sid InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 648ACFD622F3D138 NO_PUBKEY 0E98404D386FA1D9
I searched online for help on this error, and it was advised I add the following 2 commands before my update command so I can add the public keys for apt to verify:
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0E98404D386FA1D9
However, now I get a different error when running those commands:
E: gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is required for this operation
I also searched for help on that error, and I was advised to run this before the 2 new commands : apt-get update && apt-get install -y gnupg
But I can't run apt-get update. How can I fix this?