-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add step to setp qemu to fix build error (#3)
- Loading branch information
1 parent
68de43b
commit 1ac4c1b
Showing
2 changed files
with
21 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,20 @@ | ||
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=Release | ||
# start build stage | ||
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build | ||
ARG TARGETARCH | ||
WORKDIR /src | ||
COPY ["simple-api.csproj", "./"] | ||
RUN dotnet restore "simple-api.csproj" | ||
# copy csproj and restore as distinct layers | ||
COPY simple-api.csproj . | ||
RUN dotnet restore -a $TARGETARCH | ||
# copy and publish app and libraries | ||
COPY . . | ||
WORKDIR "/src/" | ||
RUN dotnet build "simple-api.csproj" -c $BUILD_CONFIGURATION -o /app/build | ||
|
||
FROM build AS publish | ||
ARG BUILD_CONFIGURATION=Release | ||
RUN dotnet publish "simple-api.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false | ||
|
||
FROM base AS final | ||
RUN dotnet publish -a $TARGETARCH -c Release --no-restore -o /app | ||
# final stage and image | ||
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine | ||
WORKDIR /app | ||
COPY --from=publish /app/publish . | ||
COPY --from=build /app . | ||
USER $APP_UID | ||
ENV ASPNETCORE_URLS=http://+:8080 | ||
ENTRYPOINT ["dotnet", "simple-api.dll"] | ||
EXPOSE 8080 |