diff --git a/Dockerfile b/Dockerfile index ae79de710..d0eb9593a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,38 +1,37 @@ -ARG BUILD_IMAGE_TAG="7.0-jammy" -ARG RUN_IMAGE_TAG="7.0-alpine" +# Usage: docker buildx build . + +ARG BUILD_IMAGE_TAG="8.0-jammy" +ARG RUN_IMAGE_TAG="8.0-alpine" + +#ARG PLATFORM=$BUILDPLATFORM +ARG PLATFORM=$TARGETPLATFORM ######################################################################### -# build and publish +# .NET build ######################################################################### -FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:$BUILD_IMAGE_TAG AS build -ARG BUILD_CONFIGURATION=Release - -ARG TARGETARCH -ARG TARGETPLATFORM -ARG BUILDPLATFORM +# ARG BUILDPLATFORM +FROM --platform=$PLATFORM mcr.microsoft.com/dotnet/sdk:$BUILD_IMAGE_TAG AS build -WORKDIR /src -COPY ["service/Service/Service.csproj", "service/Service/"] -RUN dotnet restore "./service/Service/./Service.csproj" +ARG BUILD_CONFIGURATION=Release -COPY ["extensions", "extensions"] -COPY ["tools", "tools"] -COPY ["service", "service"] +COPY . /src/ WORKDIR "/src/service/Service" -RUN dotnet build "./Service.csproj" -c $BUILD_CONFIGURATION -o /app/build - -FROM build AS publish -ARG BUILD_CONFIGURATION=Release +RUN dotnet build Service.csproj -c $BUILD_CONFIGURATION -o /app/build RUN dotnet publish "./Service.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false ######################################################################### -# run +# prepare final content ######################################################################### -FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/aspnet:$RUN_IMAGE_TAG AS base +ARG PLATFORM +FROM --platform=$PLATFORM mcr.microsoft.com/dotnet/aspnet:$RUN_IMAGE_TAG AS base + # Non-root user that will run the service ARG USER=km + +WORKDIR /app + RUN \ # Create user #Debian: useradd --create-home --user-group $USER --shell /bin/bash && \ @@ -40,23 +39,24 @@ RUN \ # Allow user to access the build chown -R $USER.$USER /app +COPY --from=build --chown=km:km --chmod=0550 /app/publish . + +######################################################################### +# runtime +######################################################################### + +LABEL org.opencontainers.image.authors="Devis Lucato, https://github.com/dluc" +MAINTAINER Devis Lucato "https://github.com/dluc" + # Define current user USER $USER # Used by .NET and KM to load appsettings.Production.json ENV ASPNETCORE_ENVIRONMENT Production ENV ASPNETCORE_URLS http://+:9001 +ENV ASPNETCORE_HTTP_PORTS 9001 -WORKDIR /app EXPOSE 9001 -FROM base AS final - -MAINTAINER Devis Lucato "https://github.com/dluc" -LABEL org.opencontainers.image.authors="Devis Lucato, https://github.com/dluc" -WORKDIR /app - -COPY --from=publish --chown=km:km --chmod=0550 /app/publish . - # Define executable ENTRYPOINT ["dotnet", "Microsoft.KernelMemory.ServiceAssembly.dll"] diff --git a/packages/icon.png b/clients/dotnet/SemanticKernelPlugin/icon.png similarity index 100% rename from packages/icon.png rename to clients/dotnet/SemanticKernelPlugin/icon.png diff --git a/clients/dotnet/WebClient/icon.png b/clients/dotnet/WebClient/icon.png new file mode 100644 index 000000000..3862f148d Binary files /dev/null and b/clients/dotnet/WebClient/icon.png differ diff --git a/nuget-package.props b/nuget-package.props index 212d7a6f5..0070a3a40 100644 --- a/nuget-package.props +++ b/nuget-package.props @@ -43,7 +43,7 @@ - + diff --git a/nuget.config b/nuget.config index 2ad126ab6..868e58a6f 100644 --- a/nuget.config +++ b/nuget.config @@ -5,16 +5,12 @@ - - - - \ No newline at end of file diff --git a/service/Core/icon.png b/service/Core/icon.png new file mode 100644 index 000000000..3862f148d Binary files /dev/null and b/service/Core/icon.png differ diff --git a/service/Service.AspNetCore/icon.png b/service/Service.AspNetCore/icon.png new file mode 100644 index 000000000..3862f148d Binary files /dev/null and b/service/Service.AspNetCore/icon.png differ