File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
app-insights-java-agent-setup Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change 1+ # Prerequisites:
2+ # 1. Shared volume mounted to /java-agent in both init-container and app container
3+ # 2. Environment variable CONNECTION_STRING in init container set to the Application Insights connection string
4+
5+ FROM mcr.microsoft.com/cbl-mariner/base/core:2.0
6+
7+ ARG version="3.5.4"
8+
9+ RUN tdnf update -y && tdnf install -y curl ca-certificates
10+
11+ RUN curl -L "https://github.com/microsoft/ApplicationInsights-Java/releases/download/${version}/applicationinsights-agent-${version}.jar" > agent.jar
12+
13+ ADD setup.sh /setup.sh
14+
15+ ENTRYPOINT ["/bin/sh" , "setup.sh" ]
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ if [[ -z " $CONNECTION_STRING " ]]; then
4+ echo " Environment variable CONNECTION_STRING is not found. Exiting..."
5+ exit 1
6+ else
7+ echo " {\" connectionString\" : \" $CONNECTION_STRING \" }" > /java-agent/applicationinsights.json
8+ cp agent.jar /java-agent/agent.jar
9+ fi
You can’t perform that action at this time.
0 commit comments