text_2025-12-19_10-41-22.txt
# Stage 1: Build the agent using the .NET SDK
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /agent-source
# These are the commands you tested manually
RUN dotnet new classlib -n SkyAgentProvider && \
cd SkyAgentProvider && \
dotnet add package SkyAPM.Agent.AspNetCore && \
dotnet publish -c Release -o /publish
# Stage 2: Final tiny image for Kubernetes
FROM busybox:latest
WORKDIR /agent
# Copy the published files from the build stage
COPY --from=build /publish .
# This command runs when the init container starts in K8s
CMD ["sh", "-c", "cp -rv . /shared-agent-vol/"] Back to List