Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is docker-compose failing with ERROR internal load metadata suddenly?

I've been running docker-compose build for days, many times per day, and haven't changed my DOCKERFILEs or docker-compose.yml. Suddenly an hour ago I started getting this:

Building frontdesk-api
failed to get console mode for stdout: The handle is invalid.
[+] Building 10.0s (3/4)
 => [internal] load build definition from Dockerfile                       0.0s
[+] Building 10.1s (4/4) FINISHED
 => [internal] load build definition from Dockerfile                       0.0s
 => => transferring dockerfile: 32B                                        0.0s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
 => ERROR [internal] load metadata for mcr.microsoft.com/dotnet/sdk:5.0.  10.0sailed to do request: Head https://mcr.microsoft.com/v2/dotnet/sdk/manifests/5.0.201-buster-slim: dial tcp: lookup mcr.microsoft.com on 192.168.65.5:53:
 => [internal] load metadata for mcr.microsoft.com/dotnet/aspnet:5.0-bust  0.0s
------
 > [internal] load metadata for mcr.microsoft.com/dotnet/sdk:5.0.201-buster-slim:
------
ERROR: Service 'frontdesk-api' failed to build

Things I've tried:

  • Running it again
  • docker rm -f $(docker ps -a -q)
  • docker login
  • Different SDK image

Here is the DOCKERFILE:

FROM mcr.microsoft.com/dotnet/aspnet:5.0-buster-slim AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:5.0.201-buster-slim AS build
WORKDIR /app
# run this from repository root
COPY ./ ./ 
#RUN ls -lha .

RUN echo 'Building FrontDesk container'

WORKDIR /app/FrontDesk/src/FrontDesk.Api
#RUN ls -lha .
RUN dotnet restore

RUN dotnet build "FrontDesk.Api.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "FrontDesk.Api.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "FrontDesk.Api.dll"]

How can I get my build working again?

like image 679
ssmith Avatar asked Apr 01 '21 22:04

ssmith


2 Answers

the solution that worked for me is to delete the .docker/config.json by running

rm  ~/.docker/config.json 

then docker-compose up your-services should work

like image 151
Carlos Avatar answered Nov 15 '22 10:11

Carlos


mcr.microsoft.com is down at the moment

I'm receiving several different errors when pulling:

% docker pull mcr.microsoft.com/dotnet/sdk:5.0
Error response from daemon: Get https://mcr.microsoft.com/v2/: Service Unavailable

% docker pull mcr.microsoft.com/dotnet/sdk:5.0
5.0: Pulling from dotnet/sdk
received unexpected HTTP status: 500 Internal Server Error
like image 33
Joe Phillips Avatar answered Nov 15 '22 08:11

Joe Phillips