You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a problem with RUN dotnet store when I build the containers. I use Macbook M1 to do it.
When I do it with my case using Linux system. It's done but with my Macbook M1, it's terrible. It took me 3 days to fix it but I don't have any solutions. Can you give me some ideas to fix it?
Steps to Reproduce
Other Information
My Dockerfile
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-alpine3.10 AS build
WORKDIR /src
COPY ["Buildee.Canvas.SignalR/Buildee.Canvas.SignalR.csproj", "Buildee.Canvas.SignalR/"]
COPY ["Buildee.Canvas/Buildee.Canvas.csproj", "Buildee.Canvas/"]
COPY ["Buildee.System.Diagnostics.Metrics/Buildee.System.Diagnostics.Metrics.csproj", "Buildee.System.Diagnostics.Metrics/"]
RUN dotnet restore "Buildee.Canvas.SignalR/Buildee.Canvas.SignalR.csproj"
COPY . .
WORKDIR "/src/Buildee.Canvas.SignalR"
RUN dotnet build "Buildee.Canvas.SignalR.csproj" -c Release -o /app
FROM build AS publish
RUN dotnet publish "Buildee.Canvas.SignalR.csproj" -c Release -o /app
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-alpine3.10 AS final
WORKDIR /app
ENV ASPNETCORE_URLS=http://*:5000 \
Serilog__WriteTo__0__Args__formatter="Serilog.Formatting.Json.JsonFormatter, Serilog"
RUN apk update && apk upgrade && apk add --no-cache jq
COPY --from=publish /app .
ADD Buildee.Canvas.SignalR/scripts/script.sh /usr/local/bin/script.sh
RUN chmod 755 /usr/local/bin/script.sh
EXPOSE 5000
ENTRYPOINT ["script.sh"]
This is because the 3.1-alpine3.10 tag you're targeting is for the amd64 architecture while the M1 Macbook uses arm64 architecture. This causes Docker to use the QEMU emulator which is not currently supported by .NET (see dotnet/runtime#47280).
Instead, it's recommended to use an arm64-specific tag (e.g. 3.1-alpine-arm64v8) if you're targeting .NET Core 3.1 or a multi-arch tag (e.g. 5.0-alpine) if you're targeting .NET 5.0.
I see that you're targeting Alpine 3.10. That version is no longer being supported for the .NET Docker images. You can see the list of currently supported tags for ASP.NET Core at https://hub.docker.com/_/microsoft-dotnet-aspnet/. If you were to use the 3.1-alpine-arm64v8 tag, you'd always be on the latest supported version of Alpine.
Describe the Bug
I have a problem with
RUN dotnet store
when I build the containers. I use Macbook M1 to do it.When I do it with my case using Linux system. It's done but with my Macbook M1, it's terrible. It took me 3 days to fix it but I don't have any solutions. Can you give me some ideas to fix it?
Steps to Reproduce
Other Information
My
Dockerfile
Output of
docker version
Output of
docker info
The text was updated successfully, but these errors were encountered: