Docker build fails with Signature failures from ubuntu and debian repos

Viewed 94

Using:

  • Host OS: Ubuntu VERSION="20.04.4 LTS (Focal Fossa)"
  • Docker version 20.10.17.

Current simple Dockerfile:

# syntax=docker/dockerfile:1
FROM ubuntu:20.04
RUN apt-get update
RUN apt-get install -y apt-utils curl nodejs postgresql-client

Running the following:

docker build --tag my-ubuntu .

Docker then started throwing the following errors since Friday:

E: The repository 'http://security.ubuntu.com/ubuntu focal-security InRelease' is not signed.
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/focal-security/InRelease  Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
E: The repository 'http://archive.ubuntu.com/ubuntu focal InRelease' is not signed.
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal/InRelease  Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-updates/InRelease  Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
E: The repository 'http://archive.ubuntu.com/ubuntu focal-updates InRelease' is not signed.
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-backports/InRelease  Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
E: The repository 'http://archive.ubuntu.com/ubuntu focal-backports InRelease' is not signed.
  • I've checked my root partition to make sure it has room already.
  • I've ran docker system df and pruned and cleaned that up as well.

I'm out of ideas why this is happening.

1 Answers

I solved this by running the following in the end:

docker build --network=host --tag my-dum-ubuntu .

Not sure why this was needed, never had to do it before. But, that's docker for you I guess.

For the docker-compose users and my builds with that tool I had to add the following to whatever service was using apt:

web:
  ...
  network_mode: "host"
  ...

And that got passed the apt commands, of course now my curl won't work so on to the next error.

Related