That is, until security showed up, saying we shouldn’t use “root” to start the container.
So add added the user in the dockerfile, made the proper chown / chmod to /opt/dynatrace. The first part goes well, downloading the agent, unzipping… Then, when the app starts, one agent isn’t started. No initialization logs, no error logs. Just nothing. Note that DT_LOGLEVELCON is set to FINEST
Removing USER my_user from the docker file fix it, but don’t fix the security issue.
Yet no matter what I do, no monitoring unless I start as root.
At this point I’m thinking the only way out is to switch to build-time injection.
You have either permission issues with loading oneagent (but you write you did a chown/chmod) or your preloading applies to root user - which is most likely. Try to add ENV LD_PRELOAD command from the docs for the user - meaning after the USER statement in the Dockerfile.
Based on your Dockerfile I belive you don’t have correct permissions on the OneAgent files in the volume you are mounting. Can you check that if you run a shell in your container?
I replaced the 777 by +x, removed capacities on the java process.
Our app don’t start, can’t bind port 80. But, dynatrace agent starts. All along we where looking for not enough permission. It was a problem of too many permissions triggering linux security.