-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
54 lines (41 loc) · 2.41 KB
/
Copy pathDockerfile
File metadata and controls
54 lines (41 loc) · 2.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# syntax=docker/dockerfile:1.7
# =============================================================================
# csharp — Windows DFIR triage agent
# =============================================================================
# Multi-stage:
# - build : dotnet/sdk:10.0 restores against $ARCP_SDK_VERSION and publishes
# both the Runtime (ASP.NET Core) and Client (CLI) projects.
# - runtime / client : minimal aspnet/runtime image consuming the published
# artifacts.
# -----------------------------------------------------------------------------
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
ARG ARCP_SDK_VERSION=latest
WORKDIR /src
COPY ArcpExample.sln nuget.config ./
COPY src/Runtime/ ./src/Runtime/
COPY src/Client/ ./src/Client/
COPY tests/SmokeTests/ ./tests/SmokeTests/
# `latest` floats to the highest available Arcp version; an explicit pin honors the user.
RUN set -eu; \
if [ "$ARCP_SDK_VERSION" = "latest" ]; then ARCP_RESTORE_VERSION=1.0.0; else ARCP_RESTORE_VERSION="$ARCP_SDK_VERSION"; fi; \
dotnet restore src/Runtime/Runtime.csproj /p:ArcpVersion="$ARCP_RESTORE_VERSION"; \
dotnet restore src/Client/Client.csproj /p:ArcpVersion="$ARCP_RESTORE_VERSION"
RUN set -eu; \
if [ "$ARCP_SDK_VERSION" = "latest" ]; then ARCP_RESTORE_VERSION=1.0.0; else ARCP_RESTORE_VERSION="$ARCP_SDK_VERSION"; fi; \
dotnet publish src/Runtime/Runtime.csproj -c Release -o /out/runtime --no-restore /p:UseAppHost=false /p:ArcpVersion="$ARCP_RESTORE_VERSION"; \
dotnet publish src/Client/Client.csproj -c Release -o /out/client --no-restore /p:UseAppHost=false /p:ArcpVersion="$ARCP_RESTORE_VERSION"
# -----------------------------------------------------------------------------
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS runtime
RUN apt-get update && apt-get install -y --no-install-recommends tini ca-certificates wget && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=build /out/runtime/ .
RUN mkdir -p /cases /reports
ENTRYPOINT ["/usr/bin/tini", "--"]
CMD ["dotnet", "/app/DfirTriage.Runtime.dll"]
# -----------------------------------------------------------------------------
FROM mcr.microsoft.com/dotnet/runtime:10.0 AS client
RUN apt-get update && apt-get install -y --no-install-recommends tini ca-certificates && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=build /out/client/ .
ENTRYPOINT ["/usr/bin/tini", "--", "dotnet", "/app/DfirTriage.Client.dll"]
CMD ["help"]