Repository is not signed in docker build

Antonio La Marra picture Antonio La Marra · Dec 2, 2019 · Viewed 21.8k times · Source

I have the following Dockerfile that uses the latest Ubuntu image pulled from dockerhub:

FROM ubuntu:latest  
RUN apt-get update  && apt-get install -y  g++ llvm lcov 

when I launch the docker build command, the following errors occur:

Err:2 http://archive.ubuntu.com/ubuntu bionic InRelease At least one invalid signature was encountered.

Err:1 http://security.ubuntu.com/ubuntu bionic-security InRelease At least one invalid signature was encountered.

Err:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease At least one invalid signature was encountered.

Err:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease At least one invalid signature was encountered.

Reading package lists...

W: GPG error: http://archive.ubuntu.com/ubuntu bionic InRelease: At least one invalid signature was encountered. E: The repository 'http://archive.ubuntu.com/ubuntu bionic InRelease' is not signed.

W: GPG error: http://security.ubuntu.com/ubuntu bionic-security InRelease: At least one invalid signature was encountered. E: The repository 'http://security.ubuntu.com/ubuntu bionic-security InRelease' is not signed.

W: GPG error: http://archive.ubuntu.com/ubuntu bionic-updates InRelease: At least one invalid signature was encountered. E: The repository 'http://archive.ubuntu.com/ubuntu bionic-updates InRelease' is not signed.

W: GPG error: http://archive.ubuntu.com/ubuntu bionic-backports InRelease: At least one invalid signature was encountered. E: The repository 'http://archive.ubuntu.com/ubuntu bionic-backports InRelease' is not signed.

I read here https://superuser.com/questions/1331936/how-can-i-get-past-a-repository-is-not-signed-message-when-attempting-to-upgr that you can pass this error using --allow-unauthenitcated or --allow-insecure-repositories but both seem to me workarounds that may compromize security of the container.

EDIT

Tried to pull ubuntu:18.04, ubuntu:19:04, ubuntu:19.10 same error with different distro name

Answer

Antonio La Marra picture Antonio La Marra · Dec 2, 2019

Apparently my root partition was full (maybe I've tried too many times to download packages through apt), and running sudo apt clean solved the issue