-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
executable file
·36 lines (24 loc) · 906 Bytes
/
Dockerfile
File metadata and controls
executable file
·36 lines (24 loc) · 906 Bytes
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
32
33
34
35
36
ARG DT_SAAS_ADDRESS=unspecified
ARG IMAGE_ALIAS=${DT_SAAS_ADDRESS}/linux/oneagent-codemodules:java
FROM openjdk:8-jdk as build
ARG GIT_COMMIT=unspecified
ENV ROOKOUT_COMMIT=$GIT_COMMIT
ARG GIT_ORIGIN=unspecified
ENV ROOKOUT_REMOTE_ORIGIN=$GIT_ORIGIN
RUN mkdir -p /app
WORKDIR /app
ADD build.gradle /app
ADD . /app
RUN ./gradlew -i bootJar downloadRook
# ---------------------------------------------------------- #
FROM $IMAGE_ALIAS as dtImage
# Lifehack
FROM openjdk:8-jdk as release
COPY --from=dtImage / /
ENV LD_PRELOAD /opt/dynatrace/oneagent/agent/lib64/liboneagentproc.so
RUN mkdir -p /app
# Copy the jar image (which already include resoures)
COPY --from=build /app/build/libs/tutorial-1.0.0.jar /app/tutorial-1.0.0.jar
# Copy the rook.jar downloaded in build phase
COPY --from=build /app/rook.jar rook.jar
ENTRYPOINT ["java", "-javaagent:rook.jar", "-jar", "/app/tutorial-1.0.0.jar"]