I was trying to build a new image for a small dotnet core 3.1 console application. I got an error:
failed to solve with frontend dockerfile.v0: failed to create LLB definition: failed to copy: httpReadSeeker: failed open: failed to do request: Get https://westeurope.data.mcr.microsoft.com/42012bb2682a4d76ba7fa17a9d9a9162-qb2vm9uiex//docker/registry/v2/blobs/sha256/87/87413803399bebbe093cfb4ef6c89d426c13a62811d7501d462f2f0e018321bb/data?P1=1627480321&P2=1&P3=1&P4=uDGSoX8YSljKnDQVR6fqniuqK8fjkRvyngwKxM7ljlM%3D&se=2021-07-28T13%3A52%3A01Z&sig=wJVu%2BBQo2sldEPr5ea6KHdflARqlzPZ9Ap7uBKcEYYw%3D&sp=r&spr=https&sr=b&sv=2016-05-31®id=42012bb2682a4d76ba7fa17a9d9a9162: x509: certificate has expired or is not yet valid
I have checked an old dotnet program which my dockerfile was working perfectly. I got the same error. Then, I jumped to Docker Hub and checked the MS Images to see that all MS images have been updated for an hour. And then they have been updated once again, 10 Minutes ago xD. However, I still cannot pull the base images of mcr.microsoft.com/dotnet/runtime:3.1 and mcr.microsoft.com/dotnet/sdk:3.1. My whole Dockerfile is:
FROM mcr.microsoft.com/dotnet/runtime:3.1 AS base
WORKDIR /app
FROM mcr.microsoft.com/dotnet/sdk:3.1 AS build
WORKDIR /src
COPY ["Kafka-dotnet-consumer/Kafka-dotnet-consumer.csproj", "Kafka-dotnet-consumer/"]
RUN dotnet restore "Kafka-dotnet-consumer/Kafka-dotnet-consumer.csproj"
COPY . .
WORKDIR "/src/Kafka-dotnet-consumer"
RUN dotnet build "Kafka-dotnet-consumer.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "Kafka-dotnet-consumer.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Kafka-dotnet-consumer.dll"]
and the complete error log is:
Severity Code Description Project File Line Suppression State
Error CTC1014 Docker command failed with exit code 1.
#1 [internal] load build definition from Dockerfile
#1 sha256:356bc2781f52b021d6dc2eefeef3212c983066d4fe3637fe7928c8165f181c52
#1 DONE 0.0s
#1 [internal] load build definition from Dockerfile
#1 sha256:356bc2781f52b021d6dc2eefeef3212c983066d4fe3637fe7928c8165f181c52
#1 transferring dockerfile: 826B done
#1 DONE 0.0s
#2 [internal] load .dockerignore
#2 sha256:158b62c61546176b0f8a68c34f4aed7fe8e5f979cc578672dacd3c07aff01eb1
#2 transferring context: 35B done
#2 DONE 0.0s
#3 [internal] load metadata for mcr.microsoft.com/dotnet/sdk:3.1-alpine
#3 sha256:9c4e2456483bc5a0fda4bf0466bb996bef09b180bf33a44ede0bd988c1be9178
#3 ...
#4 [internal] load metadata for mcr.microsoft.com/dotnet/runtime:3.1-alpine
#4 sha256:46a3f71ff7a02c9ad1111e95e06323b127c541ea25dc1bca0750bc3a2ea917ca
#4 ERROR: failed to copy: httpReadSeeker: failed open: failed to do request: Get https://westeurope.data.mcr.microsoft.com/42012bb2682a4d76ba7fa17a9d9a9162-qb2vm9uiex//docker/registry/v2/blobs/sha256/87/87413803399bebbe093cfb4ef6c89d426c13a62811d7501d462f2f0e018321bb/data?P1=1627480321&P2=1&P3=1&P4=uDGSoX8YSljKnDQVR6fqniuqK8fjkRvyngwKxM7ljlM%3D&se=2021-07-28T13%3A52%3A01Z&sig=wJVu%2BBQo2sldEPr5ea6KHdflARqlzPZ9Ap7uBKcEYYw%3D&sp=r&spr=https&sr=b&sv=2016-05-31®id=42012bb2682a4d76ba7fa17a9d9a9162: x509: certificate has expired or is not yet valid
#3 [internal] load metadata for mcr.microsoft.com/dotnet/sdk:3.1-alpine
#3 sha256:9c4e2456483bc5a0fda4bf0466bb996bef09b180bf33a44ede0bd988c1be9178
#3 CANCELED
------
> [internal] load metadata for mcr.microsoft.com/dotnet/runtime:3.1-alpine:
------
failed to solve with frontend dockerfile.v0: failed to create LLB definition: failed to copy: httpReadSeeker: failed open: failed to do request: Get https://westeurope.data.mcr.microsoft.com/42012bb2682a4d76ba7fa17a9d9a9162-qb2vm9uiex//docker/registry/v2/blobs/sha256/87/87413803399bebbe093cfb4ef6c89d426c13a62811d7501d462f2f0e018321bb/data?P1=1627480321&P2=1&P3=1&P4=uDGSoX8YSljKnDQVR6fqniuqK8fjkRvyngwKxM7ljlM%3D&se=2021-07-28T13%3A52%3A01Z&sig=wJVu%2BBQo2sldEPr5ea6KHdflARqlzPZ9Ap7uBKcEYYw%3D&sp=r&spr=https&sr=b&sv=2016-05-31®id=42012bb2682a4d76ba7fa17a9d9a9162: x509: certificate has expired or is not yet valid Kafka-dotnet-consumer C:\Ziad\repos\vdpm-datagrid\Kafka-dotnet-consumer\Kafka-dotnet-consumer\Dockerfile 1
Any ideas?
so as @Chris Culter mentioned in a comment above, I just restarted my machine and it works again.
It is kind of strange because I already updated my Docker Desktop, restarted, and cleaned/ purged the docker data. None of those helped, just after restarting my windows it works again!