I'm attempting to install Google Cloud Ops Agent on Ubuntu via Docker and running into a couple issues.
Firstly, running the following returns an error saying that some GPG signatures can't be verified:
FROM ubuntu:impish
RUN apt update
RUN apt -y install curl
RUN curl -sSO https://dl.google.com/cloudagents/add-google-cloud-ops-agent-repo.sh && bash add-google-cloud-ops-agent-repo.sh --also-install --verbose
CMD ["tail", "/dev/null"]
Error:
#6 20.71 Hit:1 http://ports.ubuntu.com/ubuntu-ports impish InRelease
#6 21.00 Hit:2 http://ports.ubuntu.com/ubuntu-ports impish-updates InRelease
#6 21.00 Get:3 https://packages.cloud.google.com/apt google-cloud-ops-agent-impish-all InRelease [5474 B]
#6 21.09 Err:3 https://packages.cloud.google.com/apt google-cloud-ops-agent-impish-all InRelease
#6 21.09 The following signatures couldn't be verified because the public key is not available: NO_PUBKEY FEEA9169307EA071 NO_PUBKEY 8B57C5C2836F4BEB
#6 21.33 Hit:4 http://ports.ubuntu.com/ubuntu-ports impish-backports InRelease
#6 21.64 Hit:5 http://ports.ubuntu.com/ubuntu-ports impish-security InRelease
#6 21.72 Reading package lists...
#6 22.12 W: GPG error: https://packages.cloud.google.com/apt google-cloud-ops-agent-impish-all InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY FEEA9169307EA071 NO_PUBKEY 8B57C5C2836F4BEB
#6 22.12 E: The repository 'https://packages.cloud.google.com/apt google-cloud-ops-agent-impish-all InRelease' is not signed.
To get around this, following some advice I found online I added:
RUN apt -y install software-properties-common
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys FEEA9169307EA071 8B57C5C2836F4BEB
Giving me the following Dockerfile:
FROM ubuntu:impish
RUN apt update
RUN apt -y install software-properties-common curl
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys FEEA9169307EA071 8B57C5C2836F4BEB
RUN curl -sSO https://dl.google.com/cloudagents/add-google-cloud-ops-agent-repo.sh && bash add-google-cloud-ops-agent-repo.sh --also-install --verbose
CMD ["tail", "/dev/null"]
Which results in a warning that apt-key
is deprecated and an "installation failed" error for Ops Agent:
#7 7.659 E: Unable to locate package google-cloud-ops-agent
#7 7.659 + fail 'google-cloud-ops-agent installation failed.'
#7 7.660 ++ date +%Y-%m-%dT%H:%M:%S%z
#7 7.661 + echo '[2022-05-02T20:40:14+0000] google-cloud-ops-agent installation failed.'
#7 7.661 [2022-05-02T20:40:14+0000] google-cloud-ops-agent installation failed.
According to Ops Agent Google docs Ubuntu Impish is supported. Changing Ubuntu from version 21.10 (impish) to 20.04 (focal) doesn't seem to help either.
Any advice on better ways of fixing the GPG issue, and getting Google Ops Agent installed on Ubuntu would be much appreciated.