Docker Community Forums

Share and learn in the Docker community.

How install java in docker

Hello, I have .net app console which uses jar file. In windows to run this app I installed newest java but how I can do it in docker? This is my dockerfile

FROM AS base
RUN apt-get update
RUN apt-get install -y software-properties-common
RUN rm -rf /var/lib/apt/lists/*

FROM AS build
COPY ["WireMockx/WireMockx.csproj", "WireMockx/"]
RUN dotnet restore "WireMockx/WireMockx.csproj"
COPY . .
WORKDIR "/src/WireMockx"
RUN dotnet build "WireMockx.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "WireMockx.csproj" -c Release -o /app/publish

FROM base AS final
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "WireMockx.dll"]