zxing-zxing
SUCCESS
9m 29s
History Source
SummaryIterations1Transcript7Dockerfile
01Iteration 1
WRITEWriteFile· step #1
0s
Dockerfile724 chars
text22 lines · 724 chars
# syntax=docker/dockerfile:1

# Build stage: use a Maven image with JDK 11 to build the project from source
FROM maven:3.8.7-jdk-11-slim AS builder
WORKDIR /workspace

# Copy the repository and build only the core module to avoid Android tooling requirements
COPY . .

# Build the core module (excluding Android-related modules) to produce a runnable JAR
RUN mvn -B -DskipTests install -pl core -am

# Runtime stage: use a minimal JRE image
FROM eclipse-temurin:11-jre
WORKDIR /app

# Copy built artifacts from the builder stage
COPY --from=builder /workspace/core/target/core-3.5.5-SNAPSHOT.jar /app/core-3.5.5-SNAPSHOT.jar

# Provide an interactive shell by default so the container is usable for exploration
CMD ["bash"]
WRITEWriteFile· step #2
0s
Dockerfile621 chars
text21 lines · 621 chars
# syntax=docker/dockerfile:1

FROM maven:3.8.7-openjdk-11-slim AS builder
WORKDIR /workspace

# Copy the repository and build only the core module to avoid Android tooling requirements
COPY . .

# Build the core module (excluding Android-related modules) to produce a runnable JAR
RUN mvn -B -DskipTests install -pl core -am

# Runtime stage: use a minimal JRE image
FROM eclipse-temurin:11-jre-slim
WORKDIR /app

# Copy built artifacts from the builder stage
COPY --from=builder /workspace/core/target/core-3.5.5-SNAPSHOT.jar /app/core-3.5.5-SNAPSHOT.jar

# Expose a shell by default for manual exploration
CMD ["bash"]
WRITEWriteFile· step #3
0s
Dockerfile685 chars
text22 lines · 685 chars
# syntax=docker/dockerfile:1

# Build stage: use a Maven image with JDK 11 to build the project from source
FROM maven:3.8.7-jdk-11 AS builder
WORKDIR /workspace

# Copy the repository and build only the core module to avoid Android tooling requirements
COPY . .

# Build the core module (excluding Android-related modules) to produce a runnable JAR
RUN mvn -B -DskipTests install -pl core -am

# Runtime stage: use a minimal JRE image
FROM eclipse-temurin:11-jre
WORKDIR /app

# Copy built artifacts from the builder stage
COPY --from=builder /workspace/core/target/core-3.5.5-SNAPSHOT.jar /app/core-3.5.5-SNAPSHOT.jar

# Expose a shell by default for manual exploration
CMD ["bash"]
WRITEWriteFile· step #4
0s
Dockerfile625 chars
text24 lines · 625 chars
# syntax=docker/dockerfile:1

FROM openjdk:11-jdk-slim AS builder
WORKDIR /workspace

# Install Maven for building the project from source
RUN apt-get update && \
    apt-get install -y --no-install-recommends maven ca-certificates curl && \
    rm -rf /var/lib/apt/lists/*

COPY . .

# Build core module (and its dependencies) from source
RUN mvn -B -DskipTests install -pl core -am

FROM openjdk:11-jre-slim
WORKDIR /app

# Copy the built core jar from the builder stage
COPY --from=builder /workspace/core/target/core-3.5.5-SNAPSHOT.jar /app/core-3.5.5-SNAPSHOT.jar

# Provide an interactive shell by default
CMD ["bash"]
WRITEWriteFile· step #5
0s
Dockerfile858 bytes written
text28 lines · 858 chars
# syntax=docker/dockerfile:1

FROM ubuntu:22.04 AS builder
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
    openjdk-11-jdk maven ca-certificates \
    && rm -rf /var/lib/apt/lists/*
ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64
ENV PATH "$PATH:$JAVA_HOME/bin"
WORKDIR /workspace

COPY . .
RUN mvn -B -DskipTests install -pl core -am

FROM ubuntu:22.04 AS runtime
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
    openjdk-11-jre-headless \
    ca-certificates \
    && rm -rf /var/lib/apt/lists/*
ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64
ENV PATH "$PATH:$JAVA_HOME/bin"
WORKDIR /app
COPY --from=builder /workspace/core/target/core-3.5.5-SNAPSHOT.jar /app/core-3.5.5-SNAPSHOT.jar

# Provide an interactive shell by default
CMD ["bash"]
WRITEWriteFile· step #6
0s
.dockerignore145 bytes written
dockerignore14 lines · 145 chars
# Ignore git, build outputs, and IDEs
.git/
.gitignore
target/
out/
**/target/
**/*.class
**/*.log
node_modules/
*.iml
.idea/
*.md.bak
.DS_Store
VERIFYVerifyBuild· step #7
6m 05s
VerifyBuildaccepted
Smoke [PASS]: test -f /app/core-3.5.5-SNAPSHOT.jar
Smoke [PASS]: java -version
Smoke [PASS]: test -s /app/core-3.5.5-SNAPSHOT.jar