forked from open-telemetry/opentelemetry-demo
-
Notifications
You must be signed in to change notification settings - Fork 36
/
Dockerfile.elastic
29 lines (20 loc) · 973 Bytes
/
Dockerfile.elastic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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.4.0
WORKDIR /usr/src/app/
COPY --from=builder /usr/src/app/ ./
ADD --chmod=644 https://oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=co.elastic.otel&a=elastic-otel-javaagent&v=LATEST /usr/src/app/opentelemetry-javaagent.jar
ENV JAVA_TOOL_OPTIONS=-javaagent:/usr/src/app/opentelemetry-javaagent.jar
ENV OTEL_INFERRED_SPANS_ENABLED=true
ENV ELASTIC_OTEL_SPAN_STACK_TRACE_MIN_DURATION=2
EXPOSE ${AD_SERVICE_PORT}
ENTRYPOINT [ "./build/install/opentelemetry-demo-ad-service/bin/AdService" ]