-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
24 lines (20 loc) · 983 Bytes
/
Dockerfile
File metadata and controls
24 lines (20 loc) · 983 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
ARG TARGETARCH
WORKDIR /src
COPY . .
RUN case "$TARGETARCH" in \
"amd64") RID="linux-x64" ;; \
"arm64") RID="linux-arm64" ;; \
*) echo "Unsupported TARGETARCH: $TARGETARCH" && exit 1 ;; \
esac \
&& dotnet restore agentpowershell.sln -r "$RID" \
&& dotnet publish src/AgentPowerShell.Cli/AgentPowerShell.Cli.csproj -c Release -r "$RID" --self-contained true -p:PublishSingleFile=true --no-restore -o /out/cli \
&& dotnet publish src/AgentPowerShell.Daemon/AgentPowerShell.Daemon.csproj -c Release -r "$RID" --self-contained true -p:PublishSingleFile=true --no-restore -o /out/daemon
FROM mcr.microsoft.com/dotnet/runtime-deps:9.0
WORKDIR /app
COPY --from=build /out/cli/ ./
COPY --from=build /out/daemon/ ./daemon/
COPY default-policy.yml /app/default-policy.yml
COPY config.yml /app/config.yml
ENV AGENTPOWERSHELL_DAEMON_PATH=/app/daemon/AgentPowerShell.Daemon
ENTRYPOINT ["./AgentPowerShell.Cli"]