DuraikannuJeyamani-6375 avatar image
0 Votes"
DuraikannuJeyamani-6375 asked

Profiling ASP.NET core application in Linux Docker container

I have created my OWN .NET Core profiler to profile core application running on Linux environment.
It was working as expected and able to get the details from my profiler.

Now, I wants to profiler .NET core application running in Docker container(Linux).
The application running successfully in container environment when there is no profiler enabled.
If we enable profiler in the container environment its getting crashed.

This is my Dockerfile,

 ***<!-- begin snippet: js hide: false console: true babel: false -->
 <!-- language: lang-html -->
     FROM AS base
     WORKDIR /app
     EXPOSE 80
     FROM AS build
     WORKDIR /src
     COPY ["DockerDemo.csproj", ""]
     RUN dotnet restore "./DockerDemo.csproj"
     COPY . .
     WORKDIR "/src/."
     RUN dotnet build "DockerDemo.csproj" -c Release -o /app/build
     FROM build AS publish
     RUN dotnet publish "DockerDemo.csproj" -c Release -o /app/publish
     COPY /app/publish
     COPY /app/publish
     FROM base AS final
     WORKDIR /app
     COPY --from=publish /app/publish .
     ENTRYPOINT ["dotnet", "DockerDemo.dll"]
     ENV CORECLR_PROFILER="{950A85A8-9E1B-4611-BEA6-E5A20686387E}"
     <!-- end snippet -->***

Here, is my profiler file developed using ICorProfilerCallback API.
When we run "docker run" command to start the container its getting crashed.

How to solve this problem ? What I missed here ?
How to load profiler in docker environment?

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

0 Answers