r/docker•
_ALH_

Random "invalid signature" GPG errors when building container

So I'm fairly new at using docker, and have a rust server I'm building a container for. But I've had this issue since start, and I can't seem to figure out why it happens. Google keeps giving me irrelevant answers or clearly chatgpt generated nonsense answers.

What happens is I randomly get this error:

0.363 Get:1 http://deb.debian.org/debian bookworm InRelease [151 kB]
0.391 Get:2 http://deb.debian.org/debian bookworm-updates InRelease [55.4 kB]
0.402 Get:3 http://deb.debian.org/debian-security bookworm-security InRelease [48.0 kB]
0.406 Err:1 http://deb.debian.org/debian bookworm InRelease
0.406   At least one invalid signature was encountered.
0.420 Err:2 http://deb.debian.org/debian bookworm-updates InRelease
0.420   At least one invalid signature was encountered.
0.434 Err:3 http://deb.debian.org/debian-security bookworm-security InRelease
0.434   At least one invalid signature was encountered.
0.436 Reading package lists...
0.440 W: GPG error: http://deb.debian.org/debian bookworm InRelease: At least one invalid signature was encountered.
0.440 E: The repository 'http://deb.debian.org/debian bookworm InRelease' is not signed.
0.440 W: GPG error: http://deb.debian.org/debian bookworm-updates InRelease: At least one invalid signature was encountered.
0.440 E: The repository 'http://deb.debian.org/debian bookworm-updates InRelease' is not signed.
0.440 W: GPG error: http://deb.debian.org/debian-security bookworm-security InRelease: At least one invalid signature was encountered.
0.440 E: The repository 'http://deb.debian.org/debian-security bookworm-security InRelease' is not signed.

Most of the time, just running docker build again, and it works. Sometimes it keep happening for a few tries, then it just works again. It's driving me crazy. My docker file is pretty basic:

FROM rust:slim-bookworm as builder
WORKDIR /usr/src/server
COPY . .
RUN apt clean
RUN apt update && apt install openssl pkg-config libssl-dev protobuf-compiler --yes
RUN cargo install --path .
FROM debian:bookworm-slim
RUN apt-get clean
RUN apt-get update & apt-get install -y openssl ca-certificates & rm -rf /var/lib/apt/lists/*
COPY --from=builder /usr/local/cargo/bin/server /usr/local/bin/server
[... some more copys and env setup ...]
CMD ["server"]

Anyone have any idea why this is happening? I'm building on a MacBook Pro M2, running MacOS Sonoma 14.2.1

It fails in the builder on this line:

   6 | >>> RUN apt update && apt install openssl pkg-config libssl-dev protobuf-compiler --yes

Posted Apr 10, 2024, 7:22 AM UTC

20

Comments aren't archived yet

Comments for this period haven't been loaded into the archive yet.