2023-11-15 17:14:53 +03:00
|
|
|
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
|
2023-07-14 21:05:16 +03:00
|
|
|
ARG version_suffix
|
2021-04-19 21:19:38 +03:00
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
COPY ./src ./kiota/src
|
2024-08-01 21:48:24 +03:00
|
|
|
COPY ./resources ./kiota/resources
|
2021-04-19 21:19:38 +03:00
|
|
|
WORKDIR /app/kiota
|
2023-07-14 21:05:16 +03:00
|
|
|
RUN if [ -z "$version_suffix" ]; then \
|
|
|
|
dotnet publish ./src/kiota/kiota.csproj -c Release -p:TreatWarningsAsErrors=false; \
|
|
|
|
else \
|
2023-11-21 21:43:04 +03:00
|
|
|
dotnet publish ./src/kiota/kiota.csproj -c Release -p:TreatWarningsAsErrors=false --version-suffix "$version_suffix"; \
|
2023-07-14 21:05:16 +03:00
|
|
|
fi
|
2021-04-19 21:19:38 +03:00
|
|
|
|
2023-11-22 15:43:34 +03:00
|
|
|
FROM mcr.microsoft.com/dotnet/runtime:8.0-jammy-chiseled AS runtime
|
2021-04-19 21:19:38 +03:00
|
|
|
WORKDIR /app
|
|
|
|
|
2023-11-15 17:14:53 +03:00
|
|
|
COPY --from=build-env /app/kiota/src/kiota/bin/Release/net8.0 ./
|
2021-04-19 21:19:38 +03:00
|
|
|
|
|
|
|
VOLUME /app/output
|
2024-07-25 15:31:05 +03:00
|
|
|
VOLUME /app/openapi.yaml
|
2023-08-17 22:50:46 +03:00
|
|
|
VOLUME /app/apimanifest.json
|
2022-05-25 15:19:29 +03:00
|
|
|
ENV KIOTA_CONTAINER=true DOTNET_TieredPGO=1 DOTNET_TC_QuickJitForLoops=1
|
2022-05-06 20:39:10 +03:00
|
|
|
ENTRYPOINT ["dotnet", "kiota.dll"]
|
2021-04-20 18:03:48 +03:00
|
|
|
LABEL description="# Welcome to Kiota Generator \
|
2023-07-10 17:07:09 +03:00
|
|
|
To start generating SDKs checkout [the getting started documentation](https://learn.microsoft.com/openapi/kiota/install#run-in-docker) \
|
|
|
|
[Source dockerfile](https://github.com/microsoft/kiota/blob/main/Dockerfile)"
|