change dotnet build images in Dockerfile
Build and Push Server Docker Image / build-server (push) Failing after 21s
Build and Push Server Docker Image / build-server (push) Failing after 21s
This commit is contained in:
1 parent
993f4fe135
commit
dc32e7c171
1 file changed
+13
-18
@@ -1,23 +1,18 @@
|
|||||||
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base
|
FROM mcr.microsoft.com/dotnet/sdk:10.0.100-preview.7-alpine3.22-aot
|
||||||
USER $APP_UID
|
AS build
|
||||||
WORKDIR /app
|
|
||||||
EXPOSE 8080
|
# Install NativeAOT build prerequisites
|
||||||
EXPOSE 8081
|
RUN apk update \
|
||||||
|
&& apk add --no-cache \
|
||||||
|
clang zlib-dev
|
||||||
|
|
||||||
|
WORKDIR /source
|
||||||
|
|
||||||
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
|
|
||||||
ARG BUILD_CONFIGURATION=Release
|
|
||||||
WORKDIR /src
|
|
||||||
COPY ["VirtualDDNSRouter.Server/VirtualDDNSRouter.Server.csproj", "VirtualDDNSRouter.Server/"]
|
|
||||||
RUN dotnet restore "VirtualDDNSRouter.Server/VirtualDDNSRouter.Server.csproj"
|
|
||||||
COPY . .
|
COPY . .
|
||||||
WORKDIR "/src/VirtualDDNSRouter.Server"
|
RUN cd 'VirtualDDNSRouter.Server' && dotnet publish -r linux-musl-x64 -o /app 'VirtualDDNSRouter.Server.csproj'
|
||||||
RUN dotnet build "./VirtualDDNSRouter.Server.csproj" -c $BUILD_CONFIGURATION -o /app/build
|
|
||||||
|
|
||||||
FROM build AS publish
|
FROM mcr.microsoft.com/dotnet/runtime-deps:10.0.0-preview.7-alpine3.22
|
||||||
ARG BUILD_CONFIGURATION=Release
|
|
||||||
RUN dotnet publish "./VirtualDDNSRouter.Server.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
|
|
||||||
|
|
||||||
FROM base AS final
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=publish /app/publish .
|
COPY --from=build /app .
|
||||||
ENTRYPOINT ["dotnet", "VirtualDDNSRouter.Server.dll"]
|
ENTRYPOINT ["/app/VirtualDDNSRouter.Server"]
|
||||||
Reference in new issue
Block a user