The repository 'http://packages.cloud.google.com/apt gcsfuse-bionic InRelease' is not signed

Viewed 205

I'm having an issue building a docker image from a dockerfile that used to work:

(My dockerfile has more steps, but this is enough to reproduce)

FROM gcr.io/deeplearning-platform-release/tf2-gpu.2-2
RUN apt-get update && \
    apt-get install --no-install-recommends -y libsndfile-dev
ENTRYPOINT ["ls", "-l"]

When running docker build, I get the following errors (in step 2):

W: GPG error: http://packages.cloud.google.com/apt gcsfuse-bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY [some key] NO_PUBKEY [some key]
E: The repository 'http://packages.cloud.google.com/apt gcsfuse-bionic InRelease' is not signed.
W: GPG error: http://packages.cloud.google.com/apt cloud-sdk-bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY [some key] NO_PUBKEY [some key]
E: The repository 'http://packages.cloud.google.com/apt cloud-sdk-bionic InRelease' is not signed.

I've tried both on my local machine and cloud builds (on google cloud), with no success.
Starting from the image tf2-gpu.2-4 instead of tf2-gpu.2-2 works, but that version is incompatible with other dependencies I rely on.
Note that the combination tf2-gpu.2-2 and libsndfile-dev worked fine before but doesn't anymore.

Why am I getting those errors and what can I do to fix them ?

Thanks!

2 Answers

This is a known issue. Read this for more info.

You can first add the correct repository GPG key using the following command.

curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -

Updated Dockerfile would be:

FROM gcr.io/deeplearning-platform-release/tf2-gpu.2-2
RUN curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
RUN apt-get update && \
    apt-get install --no-install-recommends -y libsndfile-dev
ENTRYPOINT ["ls", "-l"]

Your issue seems related to this Github issue

A dirty workaround is adding --allow-unauthenticated to your apt-get install in order to bypass the signature issue. However, I recommend you dig deeper into it to find a fix instead of a workaround.

Most likely this has to do with either your Linux version (version of the source image), apt version, or even the package version itself could be deprecated.

So your Dockerfile would look like this:

FROM gcr.io/deeplearning-platform-release/tf2-gpu.2-2
RUN apt-get update && \
    apt-get install --no-install-recommends -y libsndfile-dev
ENTRYPOINT ["ls", "-l"]

Hopefully, someone else more familiar with your packages can propose a better approach.

Related