Help Docs

Installing the Java agent in a Docker container

Installing Java agents in containerized application environments such as Docker is similar to installing them in regular server environments, except that the agent files and configurations must be part of the container image itself.

Video

Here's a quick video on how to install a Site24x7 APM Insight Java agent in a Docker container.

Please follow the steps below to achieve the same:

  1. Go to APM > APM Insight > Applications and click the Java icon.
  2. Click Download to download the APM Insight Java agent ZIP file (apminsight-javaagent.zip).
  3. Place it in the same local directory as your Spring Boot application JAR file.
    Note

    In this example, Spring Boot is the application used.

  4. Extract the ZIP file and locate the agent's jar and configuration files.
  5. Open the apminsight.conf file in any text editor to include license.key, application.name, and proxy details.
    Note

    You can get the license key from the Site24x7 APM Insight Java agent page.

  6. Next, open the Dockerfile with any text editor.
    Note

    The screenshot below is just an example; your actual Dockerfile content may differ. Please make the necessary changes.

     

  7. You can use the COPY command to copy all the APM Insight Java agent files to a directory inside the target container.
  8. Add the following environment variable:
    ENV JAVA_TOOL_OPTIONS="-javaagent:[agent_directory_full_path]/apminsight-javaagent.jar"
    Note

    This environment variable is set to help the APM Insight Java agent to hook with the application during startup.

  9. You can now use the updated Dockerfile to create your container image.
  10. Once the image is ready, you can start your application by spawning containers using the Docker image you created.
  11. Once the application is up and receiving requests, you can view the monitor under APM > APM Insight > Applications.

How to install various APM Insight agents in a Docker container
.NET | PHP | Node.js | Python

How to install various APM Insight agents in a Kubernetes environment
Java | .NET | PHP | Node.js | Python

Was this document helpful?

Would you like to help us improve our documents? Tell us what you think we could do better.


We're sorry to hear that you're not satisfied with the document. We'd love to learn what we could do to improve the experience.


Thanks for taking the time to share your feedback. We'll use your feedback to improve our online help resources.

Shortlink has been copied!