# Setup OneAgent on Containers (.NET 8)

**URL:** <https://community.dynatrace.com/t/setup-oneagent-on-containers-net-8/44828>\
**Category:** Container platforms\
**Tags:** oneagent, dotnet, kubernetes\
**Created:** [March 24, 2024, 4:05pm UTC](https://community.dynatrace.com/t/setup-oneagent-on-containers-net-8/44828 "2024-03-24T16:05:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jacoblom](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@jacoblom](https://community.dynatrace.com/u/jacoblom)\
**Post date:** [March 24, 2024, 4:05pm UTC](https://community.dynatrace.com/t/setup-oneagent-on-containers-net-8/44828/1 "2024-03-24T16:05:22Z")

</div>

Hi there,

I’m trying to following the following: Set up OneAgent on containers for application-only monitoring

```python
# The aspnet version to use (8.0)
ARG VERSION=8.0

FROM <PRIVATE-CONTAINER-REGISTRY>/aspnet-core:$VERSION AS aspnet_core
EXPOSE 8080
EXPOSE 8081

USER dotnet
FROM aspnet_core AS release
#ENV DT_HOME=/opt/dynatrace/oneagent
COPY --from=<DT_TENANT>.live.dynatrace.com/linux/oneagent-codemodules:dotnet / /

WORKDIR /app
ENV LD_PRELOAD /opt/dynatrace/oneagent/agent/lib64/liboneagentproc.so
COPY ./app .
USER dotnet
ENTRYPOINT ["/opt/dynatrace/oneagent/dynatrace-agent64.sh"]
CMD ["dotnet", "DTImage.dll"]

```

When I build and run the docker image, the only output I’m seeing is:

2024-03-24 17:57:41 Info: Using DT\_HOME: /opt/dynatrace/oneagent

If I comment&nbsp;ENTRYPOINT [“/opt/dynatrace/oneagent/dynatrace-agent64.sh”] and&nbsp;ENV LD\_PRELOAD /opt/dynatrace/oneagent/agent/lib64/liboneagentproc.so, all works fine.

It’s a very simple app (default weather forecast)

 ![jacoblom_0-1711297302204.png](https://global.discourse-cdn.com/dynatrace/original/3X/5/5/556434e8b18612edac23ed9e5eb9720f611bf1bc.png)

I’m expecting the same behaviour when doing the setting the entrypoint to the dynatrace-agent64.sh, as well as setting the LD\_PRELOAD ENV

Are there any known issues, or, can someone suggest something I should do differently?

Thank you,

---

<div class="post-metadata">

**Author:** ![jacoblom](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@jacoblom](https://community.dynatrace.com/u/jacoblom)\
**Post date:** [March 24, 2024, 5:10pm UTC](https://community.dynatrace.com/t/setup-oneagent-on-containers-net-8/44828/2 "2024-03-24T17:10:29Z")

</div>

Seems like the issue is only prevalent to .NET 8.

All works fine for .NET 6

Unless there’s someone that can advise otherwise?

Regards

---

<div class="post-metadata">

**Author:** ![mgotaquestion](https://avatars.discourse-cdn.com/v4/letter/m/8dc957/32.png) [@mgotaquestion](https://community.dynatrace.com/u/mgotaquestion)\
**Post date:** [September 5, 2024, 7:34pm UTC](https://community.dynatrace.com/t/setup-oneagent-on-containers-net-8/44828/3 "2024-09-05T19:34:17Z")

</div>

Hi, Any updates on your issue?

---

<div class="post-metadata">

**Author:** ![jacoblom](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@jacoblom](https://community.dynatrace.com/u/jacoblom)\
**Post date:** [September 5, 2024, 8:56pm UTC](https://community.dynatrace.com/t/setup-oneagent-on-containers-net-8/44828/4 "2024-09-05T20:56:06Z")

</div>

We noticed that removing the ENV COMPlus\_EnableDiagnostics=0 from the Dockerfile, fixed the problem.
