forked from ABaboshin/DotNetCoreProfiler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
40 lines (26 loc) · 1.24 KB
/
Dockerfile
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
FROM mcr.microsoft.com/dotnet/core/sdk:3.1.301 as build
COPY src src
RUN dotnet publish -c Release -o /generator src/Interception.Generator/Interception.Generator.csproj
COPY samples samples
RUN dotnet publish -c Release -o /app samples/validation/app/app.csproj
RUN dotnet publish -c Release -o /interceptor samples/validation/interceptor/interceptor.csproj
WORKDIR /interceptor
RUN dotnet ../generator/Interception.Generator.dll -a interceptor.dll,Interception.Core.dll -p /profiler -o profiler.json -s /samples/validation/skip.txt
FROM profiler:native as profiler
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1.5-bionic
RUN apt update && apt install -y dos2unix
EXPOSE 80
WORKDIR /app
ENV CORECLR_ENABLE_PROFILING=1
ENV CORECLR_PROFILER="{585022b6-31e9-4ddf-b35d-3c256d0a16f3}"
ENV CORECLR_PROFILER_PATH="/profiler/DotNetCoreProfiler.so"
ENV PROFILER_CONFIGURATION="/profiler/profiler.json"
ENV PROFILER_LOG_LEVEL="NONE"
ENTRYPOINT ["/app/run.sh"]
RUN mkdir /profiler
COPY --from=profiler /DotNetCoreProfiler.so /profiler
COPY --from=build /app /app
COPY --from=build /samples/validation/run.sh /app
RUN dos2unix /app/run.sh && chmod +x /app/run.sh
COPY --from=build /interceptor/*.dll /profiler/
COPY --from=build /interceptor/profiler.json /profiler/