apache-commons-csv
SUCCESS
9m 49s
History Source
SummaryIterations1Transcript16Dockerfile
Dockerfile21 lines · 630 chars
# Multi-stage build: compile with Maven (Java 8) and run with a minimal OpenJDK 8 runtime

FROM maven:3.8.1-openjdk-8 AS builder
WORKDIR /workspace

# Copy project files and build (skipping tests for a quicker build)
COPY pom.xml .
COPY src ./src

RUN mvn -Ddoclint=all --show-version --batch-mode --no-transfer-progress -DskipTests package

# Final runtime image with OpenJDK 8
FROM adoptopenjdk/openjdk8 AS runtime
WORKDIR /app

# Copy built jar from builder stage
COPY --from=builder /workspace/target/commons-csv-1.14.2-SNAPSHOT.jar /app/commons-csv-1.14.2-SNAPSHOT.jar

# Provide a non-blocking default shell
CMD ["/bin/sh"]