-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Dockerfile
31 lines (20 loc) · 1015 Bytes
/
Dockerfile
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
30
31
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
FROM --platform=${BUILDPLATFORM} 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 OTEL_JAVA_AGENT_VERSION
WORKDIR /usr/src/app/
COPY --from=builder /usr/src/app/ ./
ADD --chmod=644 https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v$OTEL_JAVA_AGENT_VERSION/opentelemetry-javaagent.jar /usr/src/app/opentelemetry-javaagent.jar
ENV JAVA_TOOL_OPTIONS=-javaagent:/usr/src/app/opentelemetry-javaagent.jar
EXPOSE ${AD_SERVICE_PORT}
ENTRYPOINT [ "./build/install/opentelemetry-demo-ad-service/bin/AdService" ]