FROM jfrog_url/dotnet/sdk:8.0 AS build WORKDIR /app # Copy the project file and restore dependencies COPY . ./ COPY nuget.config ./ RUN dotnet restore MyApp.SharedLibrary/MyApp.SharedLibrary.csproj --source Artifactor_url/global.nuget.virtual/index.json --configfile /app/nuget.config RUN dotnet restore MyApp.API/MyApp.API.csproj --source Artifactor_url/global.nuget.virtual/index.json --configfile /app/nuget.config ## Copy the rest of the application code # RUN cd ./MyApp.API/ && dotnet add package SkiaSharp.NativeAssets.Linux --version 3.119.1 && cd .. # Build the application RUN dotnet publish MyApp.SharedLibrary -o out --configfile /app/nuget.config RUN dotnet publish MyApp.API -o out --configfile /app/nuget.config # Use the runtime image to run the application FROM jfrog_url/dotnet/aspnet:8.0 USER $APP_UID WORKDIR /app COPY --from=build /app/out ./ USER root RUN apt-get update && apt-get install -y libc6 libfontconfig1 libfreetype6 libpng16-16 libjpeg62-turbo libgif7 && apt clean # USER $APP_UID ENTRYPOINT ["dotnet", "MyApp.API.dll"]