Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 30 additions & 30 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@
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 && \
adduser -D -h /app -s /bin/sh $USER && \
# 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"]
File renamed without changes
Binary file added clients/dotnet/WebClient/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion nuget-package.props
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
</ItemGroup>

<ItemGroup>
<None Include="$(RepoRoot)/packages/icon.png" Link="icon.png" Pack="true" PackagePath="." Visible="false" />
<None Include="icon.png" Link="icon.png" Pack="true" PackagePath="." Visible="false" />
</ItemGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
Expand Down
4 changes: 0 additions & 4 deletions nuget.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,12 @@
<packageSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="Local" value="packages" />
</packageSources>

<packageSourceMapping>
<packageSource key="nuget.org">
<package pattern="*" />
</packageSource>
<packageSource key="Local">
<package pattern="*" />
</packageSource>
</packageSourceMapping>

</configuration>
Binary file added service/Core/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added service/Service.AspNetCore/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.