Profiling ASP.NET core application in Linux Docker container

Duraikannu Jeyamani 1 Reputation point

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?

Microsoft Technologies based on the .NET software framework.
624 questions
No comments
{count} votes