19

I am trying to build Raspberry Pi docker images but I am always having the same error, similar to this one, this one and this one.

While running the command apt update as root in a arm32v7/ubuntu:20.04 (or just ubuntu:latest), I get the following output:

root@273d63597ce6:/# apt update
Get:1 http://ports.ubuntu.com/ubuntu-ports focal InRelease [265 kB]
Get:2 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease [111 kB]
Get:3 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease [98.3 kB]
Get:4 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease [107 kB]
Err:1 http://ports.ubuntu.com/ubuntu-ports focal InRelease
  At least one invalid signature was encountered.
Err:2 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease
  At least one invalid signature was encountered.
Err:3 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease
  At least one invalid signature was encountered.
Err:4 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease
  At least one invalid signature was encountered.
Reading package lists... Done
W: GPG error: http://ports.ubuntu.com/ubuntu-ports focal InRelease: At least one invalid signature was encountered.
E: The repository 'http://ports.ubuntu.com/ubuntu-ports focal InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease: At least one invalid signature was encountered.
E: The repository 'http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease: At least one invalid signature was encountered.
E: The repository 'http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://ports.ubuntu.com/ubuntu-ports focal-security InRelease: At least one invalid signature was encountered.
E: The repository 'http://ports.ubuntu.com/ubuntu-ports focal-security InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

I have tried the suggested solutions of cleaning apt, cleaning docker and removing/recreating /var/lib/apt/lists without success. The SD card is 32G and the OS is a fresh install. df shows 26G free.

Some more information:

  • This is happening on a fresh install of 2020-05-27-raspios-buster-lite-armhf on a raspberry pi 4 B
  • The same error happens on another Raspberry Pi 4 B running HypriotOS
  • The same command in the same image works fine on a raspberry pi 3 B that has Arch linux installed
  • The error does not happen if I use an older version of ubuntu (ubuntu:18.04, 16.04, 14.04)
1
  • Thanks for the reply ! I don't think this is how you prune an image, but I tried both docker image rm ubuntu:20.04 and docker system prune -a -f and it did not fix the problem. – TSpark Jul 30 '20 at 19:04
17

The root cause of the problem is in libseccomp. The newer version fixes the problem, but it is not yet available in Debian's stable repos. There are two way to fix this problem:

Method 1

Start the container with --privileged. This bypasses docker's security measures, so it is not recommended. Or with --security-opt seccomp:unconfined as a little more secure. docker run -it --security-opt seccomp:unconfined ubuntu:latest

Method 2

Upgrade libseccomp manually on the host system. Dowload version from unstable repos (I tested with 2.4.3-1) here.

Install the new version:

sudo dpkg -i libseccomp2_2.4.3-1+b1_armhf.deb

Note: The above methods solved the problems for systems based on Raspbian. The error was also happening on a Ubuntu 20.04 aarch64 system, for which @NeonLines' answer was able to help.

5
  • 2
    The "Method 2" description in this answer is helpful, although it is not immediately clear whether I need to perform the libseccomp2 upgrade on the Raspberry Pi host system or in the docker image: It needs to be upgraded in the RaspiOS host system. The forced purge of the old version is unnecessary, an upgrade performed by dpkg -i is successful without first uninstalling the old version. – Ludwig Schulze Aug 9 '20 at 15:00
  • 2
    Good to know ! I updated the answer to reflects this. – TSpark Aug 10 '20 at 14:55
  • 1
    Thanks, method 2 worked for me on rpi3. – Evgeny Bobkin Nov 3 '20 at 0:13
  • Method 2 did NOT work for me on Pi2, raspbian buster. Also docker build --privileged is not available. What now? – ManuelSchneid3r Nov 20 '20 at 13:48
  • Just upgraded it to 2.4.4-1~bpo10+1 and it worked. I am on Raspberry Pi OS (debian) Buster. Thanks for the answer. packages.debian.org/buster-backports/libseccomp2 – Giovanni Bassi Dec 21 '20 at 23:06
0

TSpark's, HyperCreeks and ibster1st123s answers did work for me on a Rasbian 10 and the latest docker version from the official repositories. As NeonLines pointed out you have to install a recent version, since they don't suffer this problem.

Most users set up Docker’s repositories and install from them, for ease of installation and upgrade tasks. This is the recommended approach, except for Raspbian. […] For Raspbian, installing using the repository is not yet supported. You must instead use the convenience script. – docs.docker.com

tl;dr

Get a recent docker version using the convenience script. You should check the link above though, there are some caveats.

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
-2
+50

Upgrading to docker version 19.03.12 has resolved this issue for me.

6
  • Thanks for the answer ! That is the version that I am currently running. From what version did you upgrade ? What is your build number from docker --version ? – TSpark Aug 5 '20 at 21:47
  • It is running build 48a6621 Edit: Also this is running 20.04.1 however I have confirmed this is working with 20.04 as well. – NeonLines Aug 5 '20 at 22:49
  • Also during the upgrade I followed the steps at here mainly the regrabbing of the key as well as removing all previous installed packages. I believe docker-ce has now moved to docker-ce-cli so this also could be playing a part if you still have the old version of docker-ce installed or other packages – NeonLines Aug 5 '20 at 22:54
  • 1
    Reinstalling and fetching the key did not solve the problem. Are you really running on a raspberry pi ? And you are able to run apt update in a ubuntu focal docker container ? Also, if that is the case, how can you specify a 20.04.1 image ? It seems it does not exists for me – TSpark Aug 6 '20 at 1:25
  • It seems like this solution did solve the problem for another machine that I had. Thanks ! – TSpark Aug 7 '20 at 17:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.