Docker Community Forums

Share and learn in the Docker community.

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?

When i checked the dependency of file got the following,

root@15997507dac6:/app# **ldd** (0x00007fff49ffe000) => /lib/x86_64-linux-gnu/ (0x00007fed800da000) => /lib/x86_64-linux-gnu/ (0x00007fed7ff15000)
/lib64/ (0x00007fed8074c000)

Can you please help me on this. How to load my profiler file in docker container?