-
Notifications
You must be signed in to change notification settings - Fork 32
/
ubuntu-test.Dockerfile
38 lines (29 loc) · 1.15 KB
/
ubuntu-test.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
32
33
34
35
36
37
38
ARG IMAGE_VERSION
ARG JAVA_VERSION
FROM ubuntu:18.04 AS builder
RUN apt-get update && apt-get install -y openjdk-8-jdk-headless
WORKDIR /app
ADD gradlew build.gradle settings.gradle gradle.properties /app/
ADD gradle gradle
RUN ./gradlew --no-daemon --version
ADD agent agent
ADD async-profiler-context async-profiler-context
ADD demo/build.gradle demo/
# for testing locally produced artifacts
#COPY async-profiler-3.0.0.1-linux-x64.tar.gz .
#COPY async-profiler-3.0.0.1-linux-arm64.tar.gz .
#COPY async-profiler-3.0.0.1-macos.zip .
RUN ./gradlew --no-daemon shadowJar
FROM ubuntu:${IMAGE_VERSION} AS runner
ARG IMAGE_VERSION
ARG JAVA_VERSION
RUN apt-get update && apt-get install -y openjdk-${JAVA_VERSION}-jdk-headless
WORKDIR /app
ADD demo demo
COPY --from=builder /app/agent/build/libs/pyroscope.jar /app/agent/build/libs/pyroscope.jar
RUN javac demo/src/main/java/Fib.java
ENV PYROSCOPE_LOG_LEVEL=debug
ENV PYROSCOPE_SERVER_ADDRESS=http://pyroscope:4040
ENV PYROSCOPE_UPLOAD_INTERVAL=5s
ENV PYROSCOPE_APPLICATION_NAME=ubuntu-${IMAGE_VERSION}-${JAVA_VERSION}
CMD ["java", "-javaagent:/app/agent/build/libs/pyroscope.jar", "-cp", "demo/src/main/java/", "Fib"]