Problem with Docker image build - expired certificates?

I’ve been having an issue with my docker images not building

It appears to be essentially the exact same issue as this previous thread:

Failed to fetch  File has unexpected size (775 != 776). Mirror sync in progress? [IP: 443]
#5 10.86    Hashes of expected file:
#5 10.86     - Filesize:776 [weak]
#5 10.86     - SHA256:e5d3c880cdb1ec15f193329e5a3abe68056c59f6026144de4d4b52fcce2131e6
#5 10.86     - SHA1:87f1583949354fe006bc0137a84d8cfe90b0229d [weak]
#5 10.86     - MD5Sum:c881892f3a46cc943e7ff44162cbee62 [weak]
#5 10.86    Release file created at: Wed, 19 Apr 2023 16:10:36 +0000
#5 10.86 E: Some index files failed to download. They have been ignored, or old ones used instead.
#5 ERROR: executor failed running [/bin/bash -c -o pipefail apt-get -y update &&   apt-get clean &&   apt-get install -y --no-install-recommends   ca-certificates]: exit code: 100

I tried the fix from that thread:

RUN apt-get -y update ; apt-get install ca-certificates && \
    apt-get -y update && \
    apt-get clean && \
    apt-get install -y --no-install-recommends \

but this does not seem to have worked. Anyone else been having this issue?

@RichardJActon can you please share the Dockerfile you are trying to build so that we can replicate and try to resolve this.

Or if you dont mind you can also share a link to your project where you have the Dockerfile.

Whatever is easier.