forked from open-telemetry/opentelemetry-demo
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add Elastic's dockerfiles for Java services
- Loading branch information
Showing
5 changed files
with
65 additions
and
6 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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Copyright The OpenTelemetry Authors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
|
||
FROM eclipse-temurin:21-jdk as builder | ||
|
||
WORKDIR /usr/src/app/ | ||
|
||
COPY ./src/adservice/gradlew* ./src/adservice/settings.gradle* ./src/adservice/build.gradle ./ | ||
COPY ./src/adservice/gradle ./gradle | ||
|
||
RUN ./gradlew | ||
RUN ./gradlew downloadRepos | ||
|
||
COPY ./src/adservice/ ./ | ||
COPY ./pb/ ./proto | ||
RUN ./gradlew installDist -PprotoSourceDir=./proto | ||
|
||
# ----------------------------------------------------------------------------- | ||
|
||
FROM eclipse-temurin:21-jre | ||
|
||
ARG version=0.3.2 | ||
WORKDIR /usr/src/app/ | ||
|
||
COPY --from=builder /usr/src/app/ ./ | ||
ADD --chmod=644 https://repo1.maven.org/maven2/co/elastic/otel/elastic-otel-javaagent/$version/elastic-otel-javaagent-$version.jar /usr/src/app/opentelemetry-javaagent.jar | ||
ENV JAVA_TOOL_OPTIONS=-javaagent:/usr/src/app/opentelemetry-javaagent.jar | ||
ENV ELASTIC_OTEL_INFERRED_SPANS_ENABLED=true | ||
|
||
EXPOSE ${AD_SERVICE_PORT} | ||
ENTRYPOINT [ "./build/install/opentelemetry-demo-ad-service/bin/AdService" ] |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Copyright The OpenTelemetry Authors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
|
||
FROM gradle:8-jdk17 AS builder | ||
|
||
WORKDIR /usr/src/app/ | ||
|
||
COPY ./src/frauddetectionservice/ ./ | ||
COPY ./pb/ ./src/main/proto/ | ||
RUN gradle shadowJar | ||
|
||
# ----------------------------------------------------------------------------- | ||
|
||
FROM gcr.io/distroless/java17-debian11 | ||
|
||
ARG version=0.3.2 | ||
WORKDIR /usr/src/app/ | ||
|
||
COPY --from=builder /usr/src/app/build/libs/frauddetectionservice-1.0-all.jar ./ | ||
ADD --chmod=644 https://repo1.maven.org/maven2/co/elastic/otel/elastic-otel-javaagent/$version/elastic-otel-javaagent-$version.jar /usr/src/app/opentelemetry-javaagent.jar | ||
ENV JAVA_TOOL_OPTIONS=-javaagent:/app/opentelemetry-javaagent.jar | ||
ENV ELASTIC_OTEL_INFERRED_SPANS_ENABLED=true | ||
|
||
ENTRYPOINT [ "java", "-jar", "frauddetectionservice-1.0-all.jar" ] |