apache-flink
FAILURE
11m 21s
History Source
SummaryIterations3Transcript17Dockerfile
01Iteration 1
WRITEWriteFile· step #1
0s
Dockerfile1312 chars
text35 lines · 1312 chars
# Multi-stage Dockerfile to build Apache Flink from source and package a runnable image

FROM maven:3.8.6-openjdk-17 AS builder
# Build in a dedicated workspace
WORKDIR /workspace

# Copy the full source tree
COPY . .

# Ensure the Maven wrapper is executable if present
RUN if [ -f mvnw ]; then chmod +x mvnw; fi

# Build Flink from source. Default to Java 17 target as used by the project docs.
# We skip tests to speed up the image creation.
RUN if [ -f mvnw ]; then ./mvnw clean package -DskipTests -Djdk17 -Pjava17-target -Dinclude_hadoop_aws || true; fi
# If the wrapper isn't present, fall back to mvn
RUN if [ ! -f mvnw ]; then mvn -V -DskipTests package -Djdk17 -Pjava17-target -Dinclude_hadoop_aws || true; fi

# Final runtime image
FROM openjdk:17-jre-slim

# Path where the Flink distribution will be placed by the build
ENV FLINK_BUILD_TARGET=/opt/flink/build-target
ENV PATH="$FLINK_BUILD_TARGET/bin:$PATH"
WORKDIR /opt/flink

# Copy the built artifacts from the builder stage
COPY --from=builder ${FLINK_BUILD_TARGET} ${FLINK_BUILD_TARGET}

# Expose a simple entrypoint that gives a shell to inspect the distribution
ENTRYPOINT ["/bin/bash"]

# Default command: show the built distribution info
CMD ["-lc", "echo 'Flink built at' ${FLINK_BUILD_TARGET}; ls -la ${FLINK_BUILD_TARGET} | head -n 50"]
WRITEWriteFile· step #2
0s
Dockerfile1357 chars
text37 lines · 1357 chars
# Multi-stage Dockerfile to build Apache Flink from source and package a runnable image

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

# Install Maven and necessary tools
RUN apt-get update \
  && apt-get install -y --no-install-recommends curl ca-certificates \
  && rm -rf /var/lib/apt/lists/*

# Install Maven 3.8.6
RUN mkdir -p /usr/share/maven /usr/share/maven/ref
RUN curl -fsSL https://archive.apache.org/dist/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.tar.gz -o /tmp/maven.tar.gz \
  && tar -xzf /tmp/maven.tar.gz -C /usr/share/maven --strip-components=1 \
  && rm /tmp/maven.tar.gz
ENV MAVEN_HOME=/usr/share/maven
ENV PATH=${MAVEN_HOME}/bin:${PATH}

# Copy source and build
COPY . .
RUN mvn -version

# Build Flink from source (Java 17 target as per docs)
RUN mvn -DskipTests -Djdk17 -Pjava17-target -Dinclude_hadoop_aws package

# Final runtime image
FROM openjdk:17-jre-slim
ENV FLINK_BUILD_TARGET=/opt/flink/build-target
ENV PATH="$FLINK_BUILD_TARGET/bin:$PATH"
WORKDIR /opt/flink

# Copy the built artifacts from the builder stage
COPY --from=builder /workspace/build-target ${FLINK_BUILD_TARGET}

# Provide a sensible default command
CMD ["bash", "-lc", "if [ -x \"$FLINK_BUILD_TARGET/bin/flink\" ]; then \"$FLINK_BUILD_TARGET/bin/flink\"; else echo 'Flink not built or not executable'; ls -la \"$FLINK_BUILD_TARGET\"; fi"]
WRITEWriteFile· step #3
0s
Dockerfile1130 bytes written
text36 lines · 1130 chars
# Multi-stage Dockerfile to build Apache Flink from source and package a runnable image

FROM ubuntu:22.04 AS builder
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
  && apt-get install -y --no-install-recommends \
     openjdk-17-jdk \
     maven \
     git \
  && rm -rf /var/lib/apt/lists/*

WORKDIR /workspace

# Copy the full repository
COPY . .

# Build Flink from source (Java 17 target as per docs)
RUN if [ -f mvnw ]; then ./mvnw clean package -DskipTests -Djdk17 -Pjava17-target -Dinclude_hadoop_aws; else mvn -V -DskipTests package -Djdk17 -Pjava17-target -Dinclude_hadoop_aws; fi

# Final runtime image
FROM ubuntu:22.04
ENV PATH=/opt/flink/build-target/bin:$PATH
WORKDIR /opt/flink

# Copy the built artifacts from the builder stage
COPY --from=builder /workspace/build-target ${BUILD_TARGET_DIR}

# Ensure the binaries are executable
RUN chmod -R a+x ${BUILD_TARGET_DIR}/bin || true

# Expose Flink UI port (optional, for convenience in demos)
EXPOSE 8081

# Default command: show available Flink binaries
CMD ["bash", "-lc", "echo 'Flink built at /opt/flink/build-target'; ls -la ${BUILD_TARGET_DIR}/bin"]
WRITEWriteFile· step #4
0s
.dockerignore129 bytes written
dockerignore14 lines · 129 chars
# Ignore common build and IDE files
.git
.gitignore
node_modules
target
build
__.m2
.DS_Store
*.md
*.log
*.tmp
*.swp
__pycache__
VERIFYVerifyBuild· step #5
26s
VerifyBuildrejected
Concerns: BUILD_TARGET_DIR is never defined as an ARG or ENV, yet it is used as the destination for COPY and in runtime commands. This will cause docker build to fail or the final image to miss the built targets., COPY --from=builder /workspace/build-target ${BUILD_TARGET_DIR} and subsequent references rely on an undefined variable, leading to an invalid image layout., The final image does not install a Java runtime; it assumes the packaged Flink build target includes its own JRE/JDK. This may or may not be true for the produced artifacts and should be validated., COPY . . copies the whole repository into the build context; consider using a .dockerignore to avoid shipping unnecessary files into the build context.
WRITEWriteFile· step #6
0s
Dockerfile1303 bytes written
text43 lines · 1303 chars
# Multi-stage Dockerfile to build Apache Flink from source and package a runnable image

FROM ubuntu:22.04 AS builder
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
  && apt-get install -y --no-install-recommends \
     openjdk-17-jdk \
     maven \
     git \
  && rm -rf /var/lib/apt/lists/*

WORKDIR /workspace

# Copy the full repository
COPY . .

# Grant execute permission to Maven wrapper if present
RUN if [ -f mvnw ]; then chmod +x mvnw; fi

# Build Flink from source (Java 17 target as per docs)
RUN if [ -f mvnw ]; then ./mvnw -DskipTests -Djdk17 -Pjava17-target -Dinclude_hadoop_aws package; else mvn -DskipTests -Djdk17 -Pjava17-target -Dinclude_hadoop_aws package; fi

# Final runtime image
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
# Install a minimal JRE to run Flink artifacts
RUN apt-get update \
  && apt-get install -y --no-install-recommends ca-certificates openjdk-17-jre-headless \
  && rm -rf /var/lib/apt/lists/*

ENV FLINK_BUILD_TARGET=/opt/flink/build-target
ENV PATH="$FLINK_BUILD_TARGET/bin:$PATH"
WORKDIR /opt/flink

# Copy the built artifacts from the builder stage
COPY --from=builder /workspace/build-target ${FLINK_BUILD_TARGET}

# Basic health / convenience information
EXPOSE 8081

# Default command: drop into a shell for inspection
CMD ["bash"]
VERIFYVerifyBuild· step #7
35s
VerifyBuildrejected
Concerns: The final stage CMD uses bash, but the final image installs only ca-certificates and openjdk-17-jre-headless; bash is not installed, which could cause runtime startup issues if the default CMD is used., The PATH is being set with an ENV that references FLINK_BUILD_TARGET (ENV PATH="$FLINK_BUILD_TARGET/bin:$PATH"). Docker ENV does not reliably expand previously defined variables in this way; this could result in PATH not including /opt/flink/build-target/bin as intended. Consider setting PATH explicitly to /opt/flink/build-target/bin or install bash and rely on a stable PATH.
WRITEWriteFile· step #8
0s
Dockerfile1457 bytes written
text42 lines · 1457 chars
# Multi-stage Dockerfile to build Apache Flink from source and package a runnable image

FROM ubuntu:22.04 AS builder
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
  && apt-get install -y --no-install-recommends \
     openjdk-17-jdk \
     maven \
     git \
  && rm -rf /var/lib/apt/lists/*

WORKDIR /workspace

# Copy the full repository
COPY . .

# Grant execute permission to Maven wrapper if present
RUN if [ -f mvnw ]; then chmod +x mvnw; fi

# Build Flink from source (Java 17 target as per docs)
RUN if [ -f mvnw ]; then ./mvnw -DskipTests -Djdk17 -Pjava17-target -Dinclude_hadoop_aws package; else mvn -DskipTests -Djdk17 -Pjava17-target -Dinclude_hadoop_aws package; fi

# Final runtime image
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
# Install a minimal JRE to run Flink artifacts
RUN apt-get update \
  && apt-get install -y --no-install-recommends ca-certificates openjdk-17-jre-headless \
  && rm -rf /var/lib/apt/lists/*

ENV FLINK_BUILD_TARGET=/opt/flink/build-target
WORKDIR /opt/flink

# Copy the built artifacts from the builder stage
COPY --from=builder /workspace/build-target ${FLINK_BUILD_TARGET}

# Basic health / convenience information
EXPOSE 8081

# Default command: show Flink version if available, otherwise drop to shell
CMD ["bash","-lc", "if [ -x ${FLINK_BUILD_TARGET}/bin/flink ]; then ${FLINK_BUILD_TARGET}/bin/flink version; else echo 'Flink not built or missing'; ls -la ${FLINK_BUILD_TARGET}; fi"]
VERIFYVerifyBuild· step #9
2m 21s
VerifyBuildbuild_failed
Build error
Failing step
- [builder 6/6] RUN if [ -f mvnw ]; then ./mvnw -DskipTests -Djdk17 -Pjava17-target -Dinclude_hadoop_aws package; else mvn -DskipTests -Djdk17 -Pjava17-target -Dinclude_hadoop_aws package; fi

Exact error message and exit code
- Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised.
- Investigate or delete /workspace/.mvn/wrapper/maven-wrapper.jar to attempt a clean download.
- If you updated your Maven version, you need to update the specified wrapperSha256Sum property.
- exit code: 1

Dockerfile/command context
- Dockerfile: RUN block shown above (builder 6/6). The final failure is the command in that step.

Missing files mentioned
- /workspace/.mvn/wrapper/maven-wrapper.jar (suggested action: delete to force a clean download)

Version mismatch info
- Hint: If Maven version was updated, you must update the wrapperSha256Sum property. The error indicates a Maven wrapper SHA-256 validation mismatch rather than a standard package/version misconfiguration.
WRITEWriteFile· step #10
0s
Dockerfile1284 bytes written
text43 lines · 1284 chars
# Multi-stage Dockerfile to build Apache Flink from source and package a runnable image

FROM ubuntu:22.04 AS builder
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
  && apt-get install -y --no-install-recommends \
     openjdk-17-jdk \
     maven \
     git \
  && rm -rf /var/lib/apt/lists/*

WORKDIR /workspace

# Copy the full repository
COPY . .

# Grant execute permission to Maven wrapper if present (not strictly required in this approach)
RUN if [ -f mvnw ]; then chmod +x mvnw; fi

# Build Flink from source (Java 17 target as per docs) using system Maven to avoid wrapper issues
RUN mvn -DskipTests -Djdk17 -Pjava17-target -Dinclude_hadoop_aws package

# Final runtime image
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
# Install a minimal JRE to run Flink artifacts
RUN apt-get update \
  && apt-get install -y --no-install-recommends ca-certificates openjdk-17-jre-headless \
  && rm -rf /var/lib/apt/lists/*

ENV FLINK_BUILD_TARGET=/opt/flink/build-target
ENV PATH=/opt/flink/build-target/bin:$PATH
WORKDIR /opt/flink

# Copy the built artifacts from the builder stage
COPY --from=builder /workspace/build-target ${FLINK_BUILD_TARGET}

# Basic health / convenience information
EXPOSE 8081

# Default command: drop into a shell for inspection
CMD ["sh"]
VERIFYVerifyBuild· step #11
1m 46s
VerifyBuildbuild_failed
GREPGrepFiles· step #12
5s
/FROM/in1 matches
show matches1
No matches found.
VERIFYVerifyBuild· step #13
1m 51s
VerifyBuildbuild_failed
LISTListDirectory· step #14
0s
.61 entries
show entries61
.asf.yaml
.dockerignore
.editorconfig
.git/
.git-blame-ignore-revs
.github/
.gitignore
.gitmodules
.idea/
.mvn/
.scalafmt.conf
DEVELOPMENT.md
Dockerfile
LICENSE
NOTICE
README.md
azure-pipelines.yml
docs/
flink-annotations/
flink-architecture-tests/
flink-clients/
flink-connectors/
flink-container/
flink-core/
flink-core-api/
flink-datastream/
flink-datastream-api/
flink-dist/
flink-dist-scala/
flink-docs/
flink-dstl/
flink-end-to-end-tests/
flink-examples/
flink-external-resources/
flink-filesystems/
flink-formats/
flink-fs-tests/
flink-kubernetes/
flink-libraries/
flink-metrics/
flink-models/
flink-python/
flink-queryable-state/
flink-quickstart/
flink-rpc/
flink-runtime/
flink-runtime-web/
flink-state-backends/
flink-streaming-java/
flink-table/
flink-test-utils-parent/
flink-tests/
flink-tests-java17/
flink-walkthroughs/
flink-yarn/
flink-yarn-tests/
licenses/
mvnw
mvnw.cmd
pom.xml
tools/
LISTListDirectory· step #15
0s
flink-dist2 entries
show entries2
flink-dist/pom.xml
flink-dist/src/
LISTListDirectory· step #16
0s
flink-dist/src2 entries
show entries2
flink-dist/src/main/
flink-dist/src/test/
LISTListDirectory· step #17
0s
flink-dist/src/main3 entries
show entries3
flink-dist/src/main/assemblies/
flink-dist/src/main/flink-bin/
flink-dist/src/main/resources/