-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Docker and NuGet Tools to .NET 8 (#384)
* Update Docker to .NET 8 * Update JRE version and target compilation * Update tools * Retargeting KNetPS * masesgroup/JNet#334 moves JVM path into environment variable, so it is no more needed it in command-line * #382 (comment): update Dockerfile(s)
- Loading branch information
1 parent
2435dad
commit 6aa6784
Showing
14 changed files
with
38 additions
and
32 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
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
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
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,24 +1,27 @@ | ||
FROM mcr.microsoft.com/dotnet/sdk:6.0-jammy AS build-env | ||
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-jammy AS build-env | ||
ARG TARGETARCH | ||
WORKDIR /app | ||
|
||
# Copy everything | ||
COPY ./src/net ./ | ||
ENV KNET_DOCKER_BUILD_ACTIONS=true | ||
# Restore as distinct layers | ||
RUN dotnet restore KNetDocker.sln | ||
RUN dotnet restore KNetDocker.sln -a $TARGETARCH | ||
# Build and publish a release | ||
RUN dotnet publish ./KNetCLI/KNetCLI.csproj --framework net6.0 -c Release -o out | ||
RUN dotnet publish ./KNetCLI/KNetCLI.csproj --framework net8.0 -c Release -o out -a $TARGETARCH | ||
|
||
# Build runtime image | ||
FROM mcr.microsoft.com/dotnet/runtime:6.0-jammy | ||
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/runtime:8.0-jammy | ||
|
||
# Add JRE | ||
RUN apt update | ||
RUN apt install -y openjdk-11-jre-headless | ||
RUN apt-get update && apt-get install -y --no-install-recommends openjdk-17-jre-headless && rm -rf /var/lib/apt/lists/* | ||
|
||
ADD ./jars /app/jars | ||
ADD ./src/config /app/config | ||
|
||
ENV JCOBRIDGE_JVMPath=/usr/lib/jvm/java-17-openjdk-amd64/lib/server/libjvm.so | ||
ENV JCOBRIDGE_LicensePath= | ||
|
||
WORKDIR /app | ||
COPY --from=build-env /app/out . | ||
ENTRYPOINT ["dotnet", "MASES.KNetCLI.dll"] |
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,24 +1,27 @@ | ||
FROM mcr.microsoft.com/dotnet/sdk:6.0-jammy AS build-env | ||
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-jammy AS build-env | ||
ARG TARGETARCH | ||
WORKDIR /app | ||
|
||
# Copy everything | ||
COPY ./src/net ./ | ||
ENV KNET_DOCKER_BUILD_ACTIONS=true | ||
# Restore as distinct layers | ||
RUN dotnet restore KNetDocker.sln | ||
RUN dotnet restore KNetDocker.sln -a $TARGETARCH | ||
# Build and publish a release | ||
RUN dotnet publish ./KNetConnect/KNetConnect.csproj --framework net6.0 -c Release -o out | ||
RUN dotnet publish ./KNetConnect/KNetConnect.csproj --framework net8.0 -c Release -o out -a $TARGETARCH | ||
|
||
# Build runtime image | ||
FROM mcr.microsoft.com/dotnet/runtime:6.0-jammy | ||
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/runtime:8.0-jammy | ||
|
||
# Add JRE | ||
RUN apt update | ||
RUN apt install -y openjdk-11-jre-headless | ||
RUN apt-get update && apt-get install -y --no-install-recommends openjdk-17-jre-headless && rm -rf /var/lib/apt/lists/* | ||
|
||
ADD ./jars /app/jars | ||
ADD ./src/config /app/config | ||
|
||
ENV JCOBRIDGE_JVMPath=/usr/lib/jvm/java-17-openjdk-amd64/lib/server/libjvm.so | ||
ENV JCOBRIDGE_LicensePath= | ||
|
||
WORKDIR /app | ||
COPY --from=build-env /app/out . | ||
ENTRYPOINT ["dotnet", "MASES.KNetConnect.dll"] |
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
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
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