-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (29 loc) · 1.14 KB
/
Dockerfile
File metadata and controls
37 lines (29 loc) · 1.14 KB
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
# Stage 1: Build
FROM maven:3.9-eclipse-temurin-21 AS build
WORKDIR /workspace
# 1. Copy specification for proto generation
COPY specification /specification
# 2. Build teststate-client-java library
COPY implementation/client/client-java /workspace/client-java
WORKDIR /workspace/client-java
RUN mvn install -DskipTests
# 3. Build junit-agent
COPY implementation/client/junit-agent /workspace/junit-agent
WORKDIR /workspace/junit-agent
RUN mvn package -DskipTests
# Stage 2: Runtime
# Using JDK because the agent uses ToolProvider (System Java Compiler)
FROM eclipse-temurin:21-jdk
WORKDIR /app
# Copy the main jar and the dependency libraries
COPY --from=build /workspace/junit-agent/target/teststate-junit-agent-*.jar /app/agent.jar
COPY --from=build /workspace/junit-agent/target/lib /app/lib
# Default environment variables
ENV HUB_URL=http://localhost:9000
ENV CLIENT_NAME=JUnitAgent-Docker
ENV JUNIT_DEPENDENCIES=org.seleniumhq.selenium:selenium-java:4.43.0
ENV SELENIUM_REMOTE_URL=http://localhost:4444/wd/hub
# Create a local maven repository directory for ShrinkWrap
RUN mkdir -p /root/.m2/repository
# Run the agent
CMD ["java", "-jar", "agent.jar"]