-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### 💰 Hva skal gjøres, og hvorfor? Tester opentelemetry og distroless image. Dette skal ta over for appdynamics ref https://nav-it.slack.com/archives/C01DE3M9YBV/p1695905476412559 --------- Co-authored-by: Stig Strøm <[email protected]>
- Loading branch information
Showing
4 changed files
with
47 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,19 @@ | ||
FROM ghcr.io/navikt/baseimages/temurin:21 | ||
FROM busybox:1.36.1-uclibc as busybox | ||
# Download opentelemetry-javaagent | ||
# https://opentelemetry.io/docs/instrumentation/java/automatic/agent-config/ | ||
FROM scratch as javaagent | ||
ARG JAVA_OTEL_VERSION=v1.32.0 | ||
ADD https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/$JAVA_OTEL_VERSION/opentelemetry-javaagent.jar /instrumentations/java/javaagent.jar | ||
|
||
ENV APPD_ENABLED=true | ||
ENV APP_NAME=familie-ba-sak | ||
# Final image | ||
FROM gcr.io/distroless/java21:nonroot | ||
COPY --from=javaagent --chown=nonroot:nonroot /instrumentations/java/javaagent.jar /app/javaagent.jar | ||
COPY --from=busybox /bin/printenv /bin/printenv | ||
COPY --chown=nonroot:nonroot ./target/familie-ba-sak.jar /app/app.jar | ||
WORKDIR /app | ||
|
||
COPY ./target/familie-ba-sak.jar "app.jar" | ||
ENV APP_NAME=familie-ba-sak | ||
ENV TZ="Europe/Oslo" | ||
# TLS Config works around an issue in OpenJDK... See: https://github.com/kubernetes-client/java/issues/854 | ||
ENTRYPOINT [ "java", "-javaagent:/app/javaagent.jar", "-Djdk.tls.client.protocols=TLSv1.2", "-jar", "/app/app.jar", "-XX:MinRAMPercentage=25.0 -XX:MaxRAMPercentage=75.0 -XX:+HeapDumpOnOutOfMemoryError" ] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters