I created dockerfile, ran it, but catched this exception:
exec /usr/bin/dotnet: exec format error
Dockerfile:
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
USER $APP_UID
WORKDIR /app
EXPOSE 8080
EXPOSE 8081
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Development
WORKDIR /src
COPY ["first-container/first-container.csproj", "first-container/"]
RUN dotnet restore "first-container/first-container.csproj"
COPY . .
WORKDIR "/src/first-container"
RUN dotnet build "first-container.csproj" -c $BUILD_CONFIGURATION -o /app/build
FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "first-container.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "first-container.dll"]
App is default Asp.Net Core web api app.
It builds correctly, but when i running it, it crashes.