Skip to content

Commit

Permalink
Update Dockerfile.linux
Browse files Browse the repository at this point in the history
  • Loading branch information
masesdevelopers authored May 14, 2024
1 parent 70f53f2 commit 63eff5f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/container/Dockerfile.linux
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
FROM mcr.microsoft.com/dotnet/sdk:8.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 JNET_DOCKER_BUILD_ACTIONS=true
# Restore as distinct layers
RUN dotnet restore JNetDocker.sln
RUN dotnet restore JNetDocker.sln -a $TARGETARCH
# Build and publish a release
RUN dotnet publish ./JNetCLI/JNetCLI.csproj --framework net8.0 -c Release -o out
RUN dotnet publish ./JNetCLI/JNetCLI.csproj --framework net8.0 -c Release -o out -a $TARGETARCH

# Build runtime image
FROM mcr.microsoft.com/dotnet/runtime:8.0-jammy
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/runtime:8.0-jammy

# Add JRE
RUN apt-get update && apt-get install -y --no-install-recommends openjdk-17-jre-headless && rm -rf /var/lib/apt/lists/*
Expand Down

0 comments on commit 63eff5f

Please sign in to comment.