Add the -javaagent Argument to the Startup Command

Edit the Dockerfile to include the -javaagent argument in the image start command based on the location where the agent binaries were copied.

For example:

ENV JAVA_OPTS -javaagent:/opt/appdynamics/javaagent.jar
CMD ["java", "$JAVA_OPTS", "-jar", "/myapp.jar"]

Note that for some Java frameworks such as Spring Boot, the existing JAVA_TOOL_OPTIONS environment variable can be leveraged to include the -javaagent argument.