Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

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.

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

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

In addition, the following commands should help clean up space:

docker system df # which can show disk usage and size of 'Build Cache'
docker image prune # add -f or --force to not prompt for confirmation
docker container prune # add -f or --force to not prompt for confirmation
                docker image prune saved 52GB on my disk and made my build run again, thank you Antonio and Erik!
– drivenuts
                Mar 13, 2020 at 10:21
                can someone explain why this failure can happen? This challenges my understanding of docker: there seem to be state kept in between run that don't make the runs deterministic.
– David 天宇 Wong
                Mar 27, 2020 at 20:21
                I tried all of the above but my issue resolved after nuking the docker build cache. At first I looked at my docker usage by: docker system df. This told me that my build cache is 50+GB. Then I nuked it using docker builder prune.
– Raashid
                May 21, 2020 at 21:47
                Amazing... it was the solution, I was staring at everything but didn't realize my root partition had run out of space.
– Antti Haapala -- Слава Україні
                Jun 1, 2020 at 0:36

Since Docker API v1.25+ ( released: Nov 18, 2019 )

Running the command below fixed the problem for me:

docker system prune --force

The --force flag stands for noninteractive prune.

Additionally, you may want to give a try to the prune volume commands:

docker volume prune --force
                docker system prune wasn't enough for me. I also needed to delete images and run docker volume prune to resolve the issue.
– Jonas Eicher
                Jan 12, 2022 at 12:27
                Thank you--- both this (increasing disk image size resource) and pruning my system resolved this for me on Docker/Mac.
– Michael Bordash
                Jan 5, 2021 at 14:11

For Raspbian, upgrade libseccomp manually on the host system by using:

curl http://ftp.us.debian.org/debian/pool/main/libs/libseccomp/libseccomp2_2.5.1-1_armhf.deb --output libseccomp2_2.5.1-1_armhf.deb
sudo dpkg -i libseccomp2_2.5.1-1_armhf.deb

This resolved my issue.

Original post is here.

Yes, that was it! It seems to be only true for the armhf-Raspberry OS. Everything works on my 64bit servers. – Christopher Gertz Aug 27, 2021 at 12:56

As @Danila and @Andriy pointed out this issue can easily be fixed running:

docker image prune -f
docker container prune -f

but posting this answer, as running just one of them didn't work for me (on MacOS X) - running both however does.

I had this problem on one of my two machines. Doing a ls -ld /tmp I got

drwxrwxrwt 3 root root 4096 May 15 20:46 /tmp

for the working one and

drwxr-xr-t 1 root root 4096 May 26 05:44 /tmp

for the failing one. After I did chmod 1777 /tmp, it worked!!

EDIT:

So, I dived a little deeper into this problem and realized there was something fundamentally wrong. I put my problems in another question and later found the answer that solved this myself: https://stackoverflow.com/a/62088961/7387935

The key point here is that on the machine that was working correctly I had aufs as storage driver and on the faulty one it was overlay2. After I changed that, all permissions were correct.

this one worked for me. I had moved the tmp folder to another drive and placed a simlink in root folder. That started to create problems with signature and many other errors. I did as you explained here, but then I moved the tmp folder back to root directory and deleted the simlink. I might just leave the tmp folder where it should stay. – tavalendo Jan 20, 2022 at 20:51

I tried again later and it worked.

From https://github.com/docker-library/php/issues/898#issuecomment-539234070:

That usually means the mirror is having issues (possibly partially out of date; i.e. not completely synced from other mirrors) and often clears itself up.

The existing answers all talk about creating more space for Docker by removing existing Docker items via docker container prune, docker image prune and docker volume prune. Alternatively it is also possible to increase the disk limit that Docker has set for it self (provided that you have enough disk space).

In Docker Desktop go to Settings > Resources and increase the "Virtual disk limit".

This has helped me since I work with several large docker images and don't want to bothered every time to prune.

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.