FROM flink:scala_2.12-java21
# Install essential build tools and dependencies
USER root
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
git \
ca-certificates \
tzdata \
&& rm -rf /var/lib/apt/lists/*
# Set working directory to build from repository root
WORKDIR /workspace
# Copy the repository contents
COPY . .
# Ensure Maven wrapper is executable
RUN chmod +x mvnw
# Build Flink from source using Java 21 target profile
RUN ./mvnw clean package -DskipTests -Djdk21 -Pjava21-target
# Default to an interactive shell to keep the container running for inspection
CMD ["bash"]
# Exclude VCS and build artifacts .git .gitignore .DS_Store # Ignore GitHub workflow and config docs .github docs/** # Maven and build outputs target/ **/target/ build/ **/build/ # Node modules (if any in repo) node_modules/ # Logs and temp files *.log *.tmp *.bak *.swp
Status: build_failed Key actionable items: - Base image tag may be invalid or outdated: flink:scala_2.12-java21. Verify the tag in the registry and its digest (sha256:55a9a32606e10abc9e7cc0199ecbf901923510b376045c4c6c4fa4e189e122c9). - Build likely relies on mvnw existing and being usable; ensure mvnw is present and executable in the source context. - Running as root detected; consider configuring a non-root user in the Dockerfile for security and reproducibility. Build details: - Build driver: docker - Dockerfile load attempted; build context transferred (162.17MB) - [1/6] FROM docker.io/library/flink:scala_2.12-java21@sha256:55a9a32606e10abc9e7cc0199ecbf901923510b376045c4c6c4fa4e189e122c9 - Metadata loaded for flink:scala_2.12-java21 - Image layers being pulled; progress partially shown (digest lines present, then truncated) - Overall status: build_error occurred during Dockerfile-based build Note: The exact failure cause inside the image layers is not shown beyond the initial FROM step and context transfer.
FROM flink:scala_2.12-java21
# Install essential build tools and dependencies (including Maven)
USER root
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
git \
ca-certificates \
tzdata \
maven \
&& rm -rf /var/lib/apt/lists/*
# Set working directory to build from repository root
WORKDIR /workspace
# Copy the repository contents
COPY . .
# Ensure Maven wrapper is executable when present
RUN if [ -f mvnw ]; then chmod +x mvnw; fi
# Build Flink from source using Java 21 target profile
# Prefer Maven wrapper if available, otherwise use system Maven
RUN if [ -f mvnw ]; then ./mvnw clean package -DskipTests -Djdk21 -Pjava21-target; else mvn clean package -DskipTests -Djdk21 -Pjava21-target; fi
# Default to an interactive shell to keep the container running for inspection
CMD ["bash"]
Status: VerifyBuild status: build_failed Key actionable details - Build assumption risk: repository must be a Maven/Gradle project with pom.xml (and -Pjava21-target if using Maven). If not, build will fail. - Base image risk: base image flink:scala_2.12-java21 may not exist in all environments; missing base image will cause failure. - Runtime note: final CMD keeps a shell open; for automatedSmoke tests use a non-interactive entrypoint or a separate health-check. Build log highlights - #0 building with "default" instance using docker driver - #1 [internal] load build definition from Dockerfile: transferred 895B, DONE 0.0s - #2 [internal] load metadata for docker.io/library/flink:scala_2.12-java21: DONE 0.9s - #3 [internal] load .dockerignore: transferring 318B, DONE 0.0s - #4 [1/6] FROM docker.io/library/flink:scala_2.12-java21@sha256:55a9a32606e10abc9e7cc0199ecbf901923510b376045c4c6c4fa4e189e122c9: resolved; 0.0s done; CACHED - #5 [internal] load build context: transferring context 3.86MB, DONE 1.4s - #6 [2/6] RUN apt-get update && apt-get install -y --no-install-recommends git ca-certificates tzdata maven && rm -rf /var/lib/apt/lists/* - apt-get fetches several Ubuntu InRelease entries (logs shown, truncated) Commands and packages - Command in Dockerfile step: apt-get update; apt-get install -y --no-install-recommends git ca-certificates tzdata maven; rm -rf /var/lib/apt/lists/* - Packages installed: git, ca-certificates, tzdata, maven - Base image: flink:scala_2.12-java21 (digest sha256:55a9a32606e10abc9e7cc0199ecbf901923510b376045c4c6c4fa4e189e122c9) Recommendation - Ensure repository provides pom.xml and uses the expected Maven/Gradle setup (or adjust Dockerfile for your build system). - Verify accessibility and existence of flink:scala_2.12-java21 base image in your environment (or pin/use an alternative base image). - For automation, switch to non-interactive entrypoint or add a health-check to the final image.
FROM flink:scala_2.12-java21
# Install essential build tools and dependencies
# Rely on Maven Wrapper (mvnw) provided by the repository to ensure correct Maven version
USER root
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
git \
ca-certificates \
tzdata \
&& rm -rf /var/lib/apt/lists/*
# Set working directory to build from repository root
WORKDIR /workspace
# Copy the repository contents
COPY . .
# Ensure Maven wrapper is executable when present
RUN if [ -f mvnw ]; then chmod +x mvnw; fi
# Build Flink from source using Java 21 target profile
# Use Maven wrapper if available, otherwise require system Maven
RUN if [ -f mvnw ]; then ./mvnw clean package -DskipTests -Djdk21 -Pjava21-target; else echo "mvn wrapper not found"; fi
# Default to an interactive shell to keep the container running for inspection
CMD ["bash"]
- VerifyBuild status: build_failed - Core gating issue: Build depends on Maven Wrapper (mvnw). If mvnw is missing, the image may only install dependencies and not compile. The Dockerfile currently echoes "mvn wrapper not found" and still creates the container. - Actionable change suggested: fail the build when mvnw is not found to enforce a build step. - Dockerfile steps (key commands and paths): - Base: FROM docker.io/library/flink:scala_2.12-java21@sha256:55a9a32606e10abc9e7cc0199ecbf901923510b376045c4c6c4fa4e189e122c9 - RUN apt-get update && apt-get install -y --no-install-recommends git ca-certificates tzdata && rm -rf /var/lib/apt/lists/* - WORKDIR /workspace - COPY . . - RUN if [ -f mvnw ]; then chmod +x mvnw; fi - RUN if [ -f mvnw ]; then ./mvnw clean package -DskipTests -Djdk21 -Pjava21-target; else echo "mvn wrapper not found"; fi - Notable log items: - [WARNING] Unknown module: jdk.compiler specified to --add-exports (repeats) - [INFO] Scanning for projects... - Maven repo access: redhat.com and central.maven.org - Maven pom paths shown: org/apache/apache/20/apache-20.pom (both redhat and central) - The log is truncated after initial download attempts; exact build failure cause not shown here - Key actionable items: - Ensure mvnw is present in the repository to trigger mvnw clean package - If mvnw is missing by design, modify Dockerfile to explicitly fail the build when mvnw is absent - Review jdk.compiler add-exports warnings if they affect runtime/JVM module access
- VerifyBuild status: build_failed - Core issue: Build step is conditional on mvnw; if mvnw is not in the repository, the image will not build from source as intended. - Base image: flink:scala_2.12-java21 (sha256:55a9a32606e10abc9e7cc0199ecbf901923510b376045c4c6c4fa4e189e122c9) - Dockerfile actions (relevant steps): - FROM docker.io/library/flink:scala_2.12-java21@sha256:55a9a32606e10abc9e7cc0199ecbf901923510b376045c4c6c4fa4e189e122c9 - WORKDIR /workspace - COPY . . - RUN if [ -f mvnw ]; then chmod +x mvnw; fi - RUN if [ -f mvnw ]; then ./mvnw clean package -DskipTests -Djdk21 -Pjava21-target; else echo "mvn wrapper not found"; fi - Commands/packages observed: - apt-get update; apt-get install -y --no-install-recommends git ca-certificates tzdata - Packages: git, ca-certificates, tzdata - Warnings during Maven run: - WARNING: Unknown module: jdk.compiler specified to --add-exports (repeated 5 times) - Maven activity (partial): - [INFO] Scanning for projects... - Downloading from redhat: ga/org/apache/apache/20/apache-20.pom - Downloading from central: maven2/org/apache/apache/20/apache-20.pom - Progress and download activity (truncated in log) - Key actionable details: - If mvnw is missing, the image will echo "mvn wrapper not found" and skip building from source. - To build from source as intended, ensure mvnw is present in the repo and included in the build context (and is executable). - Alternatively modify the Dockerfile to fail fast or to use a direct mvn invocation if mvnw is not available. - If the Java 21/module warnings are problematic, verify Java 21 export flags or adjust JAVA_TOOL_OPTIONS/MAVEN config accordingly.
FROM flink:scala_2.12-java21
# Build Flink from source using the repository in the container.
# This image aims to install minimal tooling, copy the source, and build with Maven
# using the Java 21 target as documented in the repository README.
LABEL maintainer="Apache Flink Build Agent"
# Use a dedicated work directory inside the container
WORKDIR /workspace/flink
# Install essential system utilities. We avoid pre-installing Maven to honor the
# repository's Maven wrapper when present.
RUN set -eux; \
apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
git \
unzip \
tar \
xz-utils \
wget \
&& rm -rf /var/lib/apt/lists/*
# Copy the repository source into the container
COPY . /workspace/flink
# Build the project from source. If the Maven wrapper (mvnw) is present, use it;
# otherwise install Maven and use the system mvn.
RUN set -eux; \
if [ -x "./mvnw" ]; then \
echo "Using Maven Wrapper"; \
./mvnw -v; \
./mvnw clean package -DskipTests -Djdk21 -Pjava21-target; \
else \
echo "Maven Wrapper not found, installing Maven"; \
apt-get update && apt-get install -y --no-install-recommends maven; \
mvn -v; \
mvn clean package -DskipTests -Djdk21 -Pjava21-target; \
fi
# Expose a shell to keep the container alive for inspection. The runtime user is the
# Flink user provided by the base image.
CMD ["bash"]
"} )
# Ignore version control and build artifacts .git **/.git node_modules **/node_modules target **/target build-target **/build-target **/build **/.mvn **/.m2 docs/target
Concerns: There are stray characters '}' and ')' after the CMD line, which will cause a Dockerfile syntax/parse error., Assuming the stray characters are removed, ensure the build actually produces artifacts in an expected location (e.g., flink-dist/target) for meaningful smoke tests.
FROM flink:scala_2.12-java21
# Build Flink from source using the repository in the container.
# This image aims to install minimal tooling, copy the source, and build with Maven
# using the Java 21 target as documented in the repository README.
LABEL maintainer="Apache Flink Build Agent"
# Use a dedicated work directory inside the container
WORKDIR /workspace/flink
# Run as root to install system dependencies
USER root
# Install essential system utilities. We avoid pre-installing Maven to honor the
# repository's Maven wrapper when present.
RUN set -eux; \
apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
git \
unzip \
tar \
xz-utils \
wget \
&& rm -rf /var/lib/apt/lists/*
# Copy the repository source into the container
COPY . /workspace/flink
# Build the project from source. If the Maven wrapper (mvnw) is present, use it;
# otherwise install Maven and use the system mvn.
RUN set -eux; \
if [ -x "./mvnw" ]; then \
echo "Using Maven Wrapper"; \
./mvnw -v; \
./mvnw clean package -DskipTests -Djdk21 -Pjava21-target; \
else \
echo "Maven Wrapper not found, installing Maven"; \
apt-get update && apt-get install -y --no-install-recommends maven; \
mvn -v; \
mvn clean package -DskipTests -Djdk21 -Pjava21-target; \
fi
# Run as the flink user for runtime
USER flink
# Expose a shell to keep the container alive for inspection. The runtime user is the
# Flink user provided by the base image.
CMD ["bash"]
- Status: VerifyBuild status: build_failed - Build concerns: - Build relies on Maven wrapper or system Maven; if repo lacks a Maven wrapper, build may fail in minimal environments. - COPY . /workspace/flink may copy unnecessary files; ensure .dockerignore excludes large/sensitive files. - Final runtime CMD is a shell (bash) with no startup service; suitable for a build image, not production service image. - Failing step: - Dockerfile [5/5] RUN set -eux; if [ -x "./mvnw" ]; then ... fi - Exact error messages and exit code: - "./mvnw: 219: cannot open /workspace/flink/.mvn/wrapper/maven-wrapper.properties: No such file" - "/workspace/flink/.mvn/wrapper/maven-wrapper.jar: No such file or directory" - "./mvnw: 277: cannot open /workspace/flink/.mvn/wrapper/maven-wrapper.properties: No such file" - "Error: Could not find or load main class org.apache.maven.wrapper.MavenWrapperMain" - "Caused by: java.lang.ClassNotFoundException: org.apache.maven.wrapper.MavenWrapperMain" - Exit code: 1 - Missing files mentioned: - /workspace/flink/.mvn/wrapper/maven-wrapper.properties (missing) - /workspace/flink/.mvn/wrapper/maven-wrapper.jar (missing) - The .mvn/wrapper directory/configuration is not present, causing Maven Wrapper to fail - Version/mismatch information: - Base image: flink:scala_2.12-java21 - Build uses -Djdk21 in Maven wrapper call - No explicit version mismatch reported; failure due to missing Maven Wrapper files rather than Java/Maven version incompatibility - Root cause note: - mvnw exists but wrapper files are missing; wrapper cannot initialize and falls back to a non-existent main class, causing failure. - Recommended fixes: - Provide the Maven Wrapper files: .mvn/wrapper/maven-wrapper.properties and .mvn/wrapper/maven-wrapper.jar - Or adjust Dockerfile to use system Maven if wrapper files are unavailable (remove mvnw reliance)
FROM flink:scala_2.12-java21
# Build Flink from source using the repository in the container.
# This image installs minimal tooling, copies the source, and builds with Maven
# using the Java 21 target as documented in the repository README.
LABEL maintainer="Apache Flink Build Agent"
# Use a dedicated work directory inside the container
WORKDIR /workspace/flink
# Run as root to install system dependencies
USER root
# Install essential system utilities. We avoid pre-installing Maven to honor the
# repository's Maven wrapper when present.
RUN set -eux; \
apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
git \
unzip \
tar \
xz-utils \
wget \
&& rm -rf /var/lib/apt/lists/*
# Copy the repository source into the container
COPY . /workspace/flink
# Build the project from source. If the Maven wrapper (mvnw) is usable (wrapper
# files present), use it; otherwise fall back to system Maven.
RUN set -eux; \
if [ -x "./mvnw" ] && [ -f """./.mvn/wrapper/maven-wrapper.properties""" ] && [ -f """./.mvn/wrapper/maven-wrapper.jar""" ]; then \
echo "Using Maven Wrapper"; \
./mvnw -v; \
./mvnw clean package -DskipTests -Djdk21 -Pjava21-target; \
else \
echo "Using system Maven"; \
mvn -v; \
mvn clean package -DskipTests -Djdk21 -Pjava21-target; \
fi
# Run as the flink user for runtime
USER flink
# Expose a shell to keep the container alive for inspection. The runtime user is the
# Flink user provided by the base image.
CMD ["bash"]
Concerns: RUN instruction uses invalid quoting for Maven wrapper checks: [ -f """./.mvn/wrapper/maven-wrapper.properties""" ] and [ -f """./.mvn/wrapper/maven-wrapper.jar""" ]; the triple quotes will likely cause a shell syntax error during docker build., Even if the quoting is fixed, the build relies on the presence of a Maven wrapper in a specific path; if the repository does not include the wrapper, the build falls back to system Maven, which may not be present or configured identically in all environments., The final image does not produce or expose a runnable artifact or service; it only runs a shell (CMD ["bash"]). This is acceptable for a build image, but for a runtime smoke test, you’d typically want a runnable artifact or a well-defined entrypoint., Potentially long build time inside the image (building Flink from source) could be heavy for a smoke-test workflow; consider separating build from runtime or using a multi-stage build to produce a compact runtime image., The Java target/profile flags (-Djdk21 -Pjava21-target) assume project configuration supports them; if the repository’s POM differs, the build could fail in CI environments.
FROM flink:scala_2.12-java21
# Build Flink from source using the repository in the container.
# This image installs minimal tooling, copies the source, and builds with Maven
# using the Java 21 target as documented in the repository README.
LABEL maintainer="Apache Flink Build Agent"
# Use a dedicated work directory inside the container
WORKDIR /workspace/flink
# Run as root to install system dependencies
USER root
# Install essential system utilities. We avoid pre-installing Maven to honor the
# repository's Maven wrapper when present.
RUN set -eux; \
apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
git \
unzip \
tar \
xz-utils \
wget \
&& rm -rf /var/lib/apt/lists/*
# Copy the repository source into the container
COPY . /workspace/flink
# Build the project from source. If the Maven wrapper (mvnw) is usable (wrapper
# files present), use it; otherwise fall back to system Maven. If the wrapper files
# are missing, this step will fall back to Maven installed in the base image if available.
RUN set -eux; \
if [ -x "./mvnw" ]; then \
echo "Using Maven Wrapper"; \
./mvnw -v; \
./mvnw clean package -DskipTests -Djdk21 -Pjava21-target; \
else \
echo "Maven Wrapper not found, attempting to use system Maven"; \
if command -v mvn >/dev/null 2>&1; then \
mvn -v; \
mvn clean package -DskipTests -Djdk21 -Pjava21-target; \
else \
echo "Installing Maven"; \
apt-get update && apt-get install -y --no-install-recommends maven; \
mvn -v; \
mvn clean package -DskipTests -Djdk21 -Pjava21-target; \
fi; \
fi
# Run as the flink user for runtime
USER flink
# Expose a shell to keep the container alive for inspection. The runtime user is the
# Flink user provided by the base image.
CMD ["bash"]
- VerifyBuild status: build_failed - CI/smoke-test notes: - Artifact location may vary between repo versions; tests expect artifacts under /workspace/flink. - Building from source can take long; CI needs sufficient time. - Final image ends with CMD ["bash"] and runs as the flink user; smoke tests should not rely on interactive behavior beyond basic env checks. - Failing step: [5/5] RUN set -eux; ... Maven wrapper vs system Maven logic; packaging with -DskipTests -Djdk21 -Pjava21-target - Exact failing messages (exit code 1): - ./mvnw: 219: cannot open /workspace/flink/.mvn/wrapper/maven-wrapper.properties: No such file - /workspace/flink/.mvn/wrapper/maven-wrapper.jar: No such file or directory - ./mvnw: 277: cannot open /workspace/flink/.mvn/wrapper/maven-wrapper.properties: No such file - Error: Could not find or load main class org.apache.maven.wrapper.MavenWrapperMain - Caused by: java.lang.ClassNotFoundException: org.apache.maven.wrapper.MavenWrapperMain - Missing files/packages: - /workspace/flink/.mvn/wrapper/maven-wrapper.properties: No such file - /workspace/flink/.mvn/wrapper/maven-wrapper.jar: No such file or directory - As a result, Maven Wrapper main class could not be loaded (org.apache.maven.wrapper.MavenWrapperMain) - Version/target info: - Java 21: -Djdk21 -Pjava21-target - Image: flink:scala_2.12-java21 - Root cause: - Maven Wrapper artifacts missing (wrapper properties and wrapper jar), causing MavenWrapperMain to be unavailable. - Actionable next steps: - Ensure .mvn/wrapper/maven-wrapper.properties and .jar exist in the repository at the expected path. - Verify mvnw script is present and correctly references the wrapper. - If wrapper artifacts cannot be trusted to exist, adjust Dockerfile/build to use system Maven (or preinstall Maven) and bypass the wrapper.
FROM flink:scala_2.12-java21
# Build Flink from source using the repository in the container.
# This image installs required tooling (Maven) and builds with the Java 21 target as documented in the repository README.
LABEL maintainer="Apache Flink Build Agent"
WORKDIR /workspace/flink
# Install system dependencies including Maven (wrapper is not assumed to be present in the repo)
USER root
RUN set -eux; \
apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
git \
unzip \
tar \
xz-utils \
wget \
maven \
&& rm -rf /var/lib/apt/lists/*
# Copy the repository source into the container
COPY . /workspace/flink
# Build the project from source using Maven directly
RUN set -eux; \
mvn -v; \
mvn clean package -DskipTests -Djdk21 -Pjava21-target
# Switch to the standard Flink user for any subsequent operations
USER flink
# Provide an interactive shell for inspection if needed
CMD ["bash"]
Status: VerifyBuild: build_failed Concerns: - Maven build uses -Djdk21; ensure the repository POM recognizes this property or adjust to the project's expected flags. - COPY . /workspace/flink may copy large or unwanted files; consider a .dockerignore to reduce build context size. Build details: - Base image: flink:scala_2.12-java21 @ sha256:55a9a32606e10abc9e7cc0199ecbf901923510b376045c4c6c4fa4e189e122c9 - Workdir: /workspace/flink - RUN step: set -eux; apt-get update && apt-get install -y --no-install-recommends ca-certificates curl git unzip tar xz-utils wget maven && rm -rf /var/lib/apt/lists/* - Packages installed: ca-certificates, curl, git, unzip, tar, xz-utils, wget, maven - Build context size transferred: 3.96MB - Dockerfile steps: - [1/5] FROM docker.io/library/flink:scala_2.12-java21@sha256:... - [2/5] WORKDIR /workspace/flink - [3/5] RUN ... apt-get update && apt-get install ... - [4/5] load build context - [5/5] resolve image/tag - Supporting files loaded: .dockerignore - Build driver: docker - Note: Logs show apt-get progress; no final error details beyond the initial build_failure provided.
Summary: - Status: VerifyBuild status: build_failed - Key concerns: - Build may be long and rely on network access during image build; ensure CI has enough time/resources. - COPY . /workspace/flink assumes the build context contains the Flink repo; ensure .dockerignore doesn’t exclude essential files. - Final image may include large build artifacts under /workspace/flink/target; consider cleaning in a later layer to reduce image size. - Build details: - Base image: docker.io/library/flink:scala_2.12-java21@sha256:55a9a32606e10abc9e7cc0199ecbf901923510b376045c4c6c4fa4e189e122c9 - Working dir: /workspace/flink - Installed packages (during RUN): ca-certificates, curl, git, unzip, tar, xz-utils, wget, maven - Context size: 3.95MB - Commands executed: - mvn -v - mvn clean package -DskipTests -Djdk21 -Pjava21-target - Maven/Java environment: - Maven: 3.8.7 - Java: 21.0.10 (Eclipse Adoptium) - OS: linux 6.8.0-106-generic, amd64 - Build steps/logs: - [1/5] FROM ... flink:scala_2.12-java21 - [2/5] WORKDIR /workspace/flink - [3/5] apt-get install ... (dependencies) - [4/5] COPY . /workspace/flink - [5/5] Maven build initiated; log shows mvn -v, then project scan and downloads - Observations: - The log shows Maven starting to download POMs from redhat and central repositories; the excerpt ends with truncated progress, so the precise failure cause isn’t shown here.
Actionable summary
- Status: VerifyBuild status: build_failed
- Concerns
- FROM tag flink:scala_2.12-java21 assumes image exists and is accessible; verify the tag is correct and maintained.
- Build uses Maven with -Djdk21 and -Pjava21-target; ensure the repository supports these flags and the build completes in reasonable time.
- COPY . /workspace/flink may copy a large context; ensure .dockerignore excludes heavy files to keep image build efficient.
- Build context and steps
- Base image: docker.io/library/flink:scala_2.12-java21@sha256:55a9a32606e10abc9e7cc0199ecbf901923510b376045c4c6c4fa4e189e122c9
- Build context size: 3.95MB
- Working directory: /workspace/flink
- COPY command: COPY . /workspace/flink
- Maven invocation sequence:
- mvn -v
- mvn clean package -DskipTests -Djdk21 -Pjava21-target
- Maven/Java details observed:
- Apache Maven 3.8.7
- Java version: 21.0.10, vendor: Eclipse Adoptium, runtime: /opt/java/openjdk
- OS: linux 6.8.0-106-generic, arch: amd64
- Repositories accessed/POMs downloaded:
- https://maven.repository.redhat.com/ga/org/apache/apache/20/apache-20.pom
- https://repo.maven.apache.org/maven2/org/apache/apache/20/apache-20.pom
- Progress shown indicates scanning for projects and downloading POMs; final build result not shown in excerpt (truncated output).
- Key file paths and identifiers
- /workspace/flink
- flink:scala_2.12-java21 (image tag)
- sha256 digest: 55a9a32606e10abc9e7cc0199ecbf901923510b376045c4c6c4fa4e189e122c9
- Maven/Java: Apache Maven 3.8.7, Java 21.0.10 (Eclipse Adoptium)
- Repro commands (from log)
- mvn -v
- mvn clean package -DskipTests -Djdk21 -Pjava21-target
Note: The output ends with a truncated section after downloading central/pom files; no final success/failure detail shown beyond build_failed.Actionable summary - Status: VerifyBuild status: build_failed - Smoke test concerns: - Relies on a distribution tarball present at /workspace/flink; path conventions vary across Flink versions/Maven profiles. - Smoke tests only verify build artifacts and basic tools (mvn, java), not actual Flink runtime or a full job run. - Build/log highlights: - Base image: flink:scala_2.12-java21 with sha256:55a9a32606e10abc9e7cc0199ecbf901923510b376045c4c6c4fa4e189e122c9 - Working directory: /workspace/flink - Final step command: mvn -v; mvn clean package -DskipTests -Djdk21 -Pjava21-target - Maven: Apache Maven 3.8.7; Maven home: /usr/share/maven - Java: 21.0.10, vendor Eclipse Adoptium; runtime: /opt/java/openjdk - OS: linux, 6.8.0-106-generic, amd64 - Maven repo activity: Downloading from redhat: https://maven.repository.redhat.com/ga/org/apache/apache/20/apache-20.pom and from central: https://repo.maven.apache.org/maven2/org/apache/apache/20/apache-20.pom - Output shows progress updates and a [truncated] log segment, indicating long output but no explicit failure message in the excerpt. - File/paths involved: - /workspace/flink (artifact/workspace context) - Packages in image (from build steps): ca-certificates, curl, git, unzip, tar, xz-utils, wget, maven - Next steps recommended for debugging: - Ensure the tarball artifact is placed at /workspace/flink for smoke tests. - Retrieve full Maven build error messages from the docker build to identify the failure cause.
# Stage 1: Build Flink from source using Maven in a full-featured image FROM maven:3.8.9-openjdk-21 AS builder WORKDIR /workspace/flink # Copy the repository source into the builder COPY . /workspace/flink # Build the project from source using Maven. We rely on the repository's pom.xml having the correct # configuration for Java 21 and the java21-target profile. RUN mvn -v && mvn clean package -DskipTests -Djdk21 -Pjava21-target # Stage 2: Create the final image based on the official Flink runtime base image FROM flink:scala_2.12-java21 WORKDIR /workspace/flink # Copy built artifacts from builder stage if present COPY --from=builder /workspace/flink/build-target /build-target # Provide an interactive shell for inspection and basic validation CMD ["bash"]
FROM flink:scala_2.12-java21
LABEL maintainer="Apache Flink Build Agent"
# Work directory for the repository
WORKDIR /workspace/flink
USER root
# Install essential build tools including Maven (wrapper files are not assumed to exist)
RUN set -eux; \
apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
git \
unzip \
tar \
xz-utils \
wget \
maven \
&& rm -rf /var/lib/apt/lists/*
# Copy the repository into the image
COPY . /workspace/flink
# Build the project from source using Maven directly
RUN set -eux; \
mvn -v; \
mvn clean package -DskipTests -Djdk21 -Pjava21-target
# Use the flink user for the final container
USER flink
CMD ["bash"]
Summary of tool output (actionable info preserved) Status and concerns - VerifyBuild status: build_failed - Concerns: - Uses Maven profile -Pjava21-target and flag -Djdk21; verify these are valid across environments using this image. - COPY . /workspace/flink copies the entire repo; add .dockerignore to avoid sending large or sensitive files. - No explicit test of the built artifact; consider a follow-up smoke test to verify a jar is produced. Build attempt details - Base image: docker.io/library/flink:scala_2.12-java21@sha256:55a9a32606e10abc9e7cc0199ecbf901923510b376045c4c6c4fa4e189e122c9 - Working directory: /workspace/flink - Installed packages (apt-get): ca-certificates, curl, git, unzip, tar, xz-utils, wget, maven - Maven/Java info: - mvn -v outputs Apache Maven 3.8.7 - Java version: 21.0.10, vendor: Eclipse Adoptium, runtime: /opt/java/openjdk - Commands run: - mvn -v - mvn clean package -DskipTests -Djdk21 -Pjava21-target - Build flow (selected steps): - [1/5] load build definition - [2/5] load docker image metadata - [3/5] load .dockerignore - [4/5] FROM flink:scala_2.12-java21 - [5/5] RUN mvn -v; mvn clean package -DskipTests -Djdk21 -Pjava21-target - Maven activity: - Scanning for projects - Downloading from redhat.maven: ga/org/apache/apache/20/apache-20.pom - Downloading from central: maven2/org/apache/apache/20/apache-20.pom - Progress indicators shown; log appears truncated after initial downloads - Result: build_failed (exact error message not fully visible due to truncation) Files/paths and versions to note - Context and code path: /workspace/flink - Docker image reference: flink:scala_2.12-java21 with SHA256 digest - Maven/Java versions used in this run: - Apache Maven 3.8.7 - Java 21.0.10 (Eclipse Adoptium) Recommended follow-ups - Confirm that -Pjava21-target and -Djdk21 are supported by the project’s pom.xml and environment. - Add a .dockerignore to Docker builds to exclude large or sensitive files from the build context. - Add a smoke test post-build that verifies a jar is produced (e.g., check for target/*.jar) to catch missing artifacts early.
Summary of tool output (preserve actionable details): - Status: VerifyBuild status: build_failed - Build driver: docker, default instance - Base image: flink:scala_2.12-java21@sha256:55a9a32606e10abc9e7cc0199ecbf901923510b376045c4c6c4fa4e189e122c9 - Docker steps (trimmed to essentials): - load Dockerfile, load build metadata, load build context (3.95MB) - WORKDIR /workspace/flink - COPY . /workspace/flink - mvn -v - mvn clean package -DskipTests -Djdk21 -Pjava21-target - Working directory: /workspace/flink - apt-get installed packages (during image setup): ca-certificates, curl, git, unzip, tar, xz-utils, wget, maven - Maven/Java environment: - Apache Maven 3.8.7 - Java version: 21.0.10, vendor: Eclipse Adoptium, runtime: /opt/java/openjdk - Default locale: en_US, platform encoding: UTF-8 - OS: linux 6.8.0-106-generic, arch: amd64 - Repositories accessed: - redhat GA: https://maven.repository.redhat.com/ga/org/apache/apache/20/apache-20.pom - central: https://repo.maven.apache.org/maven2/org/apache/apache/20/apache-20.pom - Project/workspace: - Source copied: /workspace/flink - Commands to reproduce: - mvn -v - mvn clean package -DskipTests -Djdk21 -Pjava21-target - Note: The log is truncated after repository downloads; exact cause of failure not shown here.
# Build a Flink distribution from source using the official Flink Java 21 base image
# Stage 1: build from source with Maven (wrapper if present)
FROM flink:scala_2.12-java21 AS builder
# Install required build tools (Maven and essential utilities)
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
maven \
curl \
ca-certificates \
git \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /workspace/flink
# Copy the full repository into the build context
COPY . .
# Ensure Maven wrapper (if present) is executable
RUN if [ -f "./mvnw" ]; then chmod +x ./mvnw; fi
# Build Flink from source for Java 21 using the documented wrapper/profile
RUN set -e; \
if [ -f "./mvnw" ]; then \
./mvnw clean package -DskipTests -Djdk21 -Pjava21-target; \
else \
mvn clean package -DskipTests -Djdk21 -Pjava21-target; \
fi
# Stage 2: Runtime image containing the built distribution
FROM flink:scala_2.12-java21
WORKDIR /workspace/flink
# Copy the built distribution from the builder stage
COPY --from=builder /workspace/flink/build-target ./build-target
ENV FLINK_HOME=/workspace/flink/build-target
ENV PATH="$FLINK_HOME/bin:$PATH"
# Ensure correct ownership for the flink user
USER root
RUN chown -R flink:flink /workspace/flink
USER flink
# Default to an interactive shell; user can override CMD to run Flink
CMD ["bash"]
# Ignore VCS and local IDE files .git .github *.log target build-target *.class .DS_Store # Ignore IDE folders .idea .vscode # Misc cache node_modules
- Exact error message and exit code - ERROR: process "/bin/sh -c apt-get update && apt-get install -y --no-install-recommends maven curl ca-certificates git && rm -rf /var/lib/apt/lists/*" did not complete successfully: exit code: 100 - 0.201 E: List directory /var/lib/apt/lists/partial is missing. - Acquire (13: Permission denied) - Failing command/step - [builder 2/6] RUN apt-get update && apt-get install -y --no-install-recommends maven curl ca-certificates git && rm -rf /var/lib/apt/lists/* - Missing packages or files mentioned - Packages intended to install: maven, curl, ca-certificates, git - Additional issue: E: List directory /var/lib/apt/lists/partial is missing. - Acquire (13: Permission denied) - Version mismatch info - Base image used: flink:scala_2.12-java21 (sha256:55a9a32606e10abc9e7cc0199ecbf901923510b376045c4c6c4fa4e189e122c9) - Tag indicates Java 21 / Scala 2.12; no explicit version mismatch error is shown beyond this base image usage.
# Build a Flink distribution from source using the official Flink Java 21 base image
# Stage 1: build from source with Maven (wrapper if present)
FROM flink:scala_2.12-java21 AS builder
# Ensure we are running as root to install build dependencies
USER root
# Install required build tools (Maven and essential utilities)
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
maven \
curl \
ca-certificates \
git \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /workspace/flink
# Copy the full repository into the build context
COPY . .
# Ensure Maven wrapper (if present) is executable
RUN if [ -f "./mvnw" ]; then chmod +x ./mvnw; fi
# Build Flink from source for Java 21 using the documented wrapper/profile
RUN set -e; \
if [ -f "./mvnw" ]; then \
./mvnw clean package -DskipTests -Djdk21 -Pjava21-target; \
else \
mvn clean package -DskipTests -Djdk21 -Pjava21-target; \
fi
# Stage 2: Runtime image containing the built distribution
FROM flink:scala_2.12-java21
WORKDIR /workspace/flink
# Copy the built distribution from the builder stage
COPY --from=builder /workspace/flink/build-target ./build-target
ENV FLINK_HOME=/workspace/flink/build-target
ENV PATH="$FLINK_HOME/bin:$PATH"
# Ensure correct ownership for the flink user
USER root
RUN chown -R flink:flink /workspace/flink
USER flink
# Default to an interactive shell; user can override CMD to run Flink
CMD ["bash"]
- Status: VerifyBuild status: build_failed
- Key concerns
- Build-target path assumption: /workspace/flink/build-target. If Maven writes artifacts elsewhere (e.g., build/distributions), the COPY in the final image will fail and the distribution may be unusable.
- COPY . . copies the entire repository into the builder stage, risking image bloat or leaking sensitive files without a proper .dockerignore.
- PATH construction via Dockerfile ENV expansions can be brittle across Docker versions; consider explicit PATH=${FLINK_HOME}/bin:${PATH}.
- Final image defaults to CMD ["bash"]; for automation, consider a non-interactive CMD or HEALTHCHECK.
- Build details
- Build driver: docker
- Base image: flink:scala_2.12-java21@sha256:55a9a32606e10abc9e7cc0199ecbf901923510b376045c4c6c4fa4e189e122c9
- Working directory: /workspace/flink
- RUN step: apt-get update && apt-get install -y --no-install-recommends maven curl ca-certificates git && rm -rf /var/lib/apt/lists/*
- Apt-get logs show Ubuntu noble releases; packages installed: maven, curl, ca-certificates, git
- Files and commands to note
- COPY . . (in builder)
- Final image CMD: ["bash"]
- Actionable follow-ups
- Ensure Maven outputs align with /workspace/flink/build-target or adjust COPY path accordingly.
- Add a proper .dockerignore to prevent large/sensitive files from being copied.
- Use an explicit PATH assignment, e.g., PATH=${FLINK_HOME}/bin:${PATH}, to improve portability.
- Consider adding a non-interactive CMD or a HEALTHCHECK for automation.Actionable summary: - VerifyBuild status: build_failed - Key concerns - Build output path risk: Flink version differences may change where the final distribution is written. Dockerfile assumes the final distribution is copied to /workspace/flink/build-target. - Build context size: Dockerfile uses COPY . . which copies the entire repository; restrict to only files needed to reduce build context and image size. - Entrypoint: No explicit entrypoint; image defaults to an interactive shell. For production, add an entrypoint to run Flink services by default. - Build details (selected, relevant items) - Build attempted with docker driver: “#0 building with "default" instance using docker driver” - Base image: flink:scala_2.12-java21 (Docker Hub tag) - Metadata step: #2 load metadata for docker.io/library/flink:scala_2.12-java21 - Dockerfile context: #3 load .dockerignore - Dockerfile stage: #4 [builder 1/6] FROM docker.io/library/flink:scala_2.12-java21@sha256:55a9a32606e10abc9e7cc0199ecbf901923510b376045c4c6c4fa4e189e122c9 - Layer activity shown (various sha256 digests and progress) but the log ends with [truncated], indicating the rest of the steps are not shown. - Important names/paths/versions - Final distribution path referenced: /workspace/flink/build-target - Docker base image: flink:scala_2.12-java21 - Dockerfile copying command: COPY . . - Recommended actions - Align build output with /workspace/flink/build-target or adjust Dockerfile to place artifacts there regardless of Flink version. - Change Dockerfile to copy only necessary files (e.g., specific src or artifacts) instead of the entire repo. - Add an ENTRYPOINT (or CMD) in the Dockerfile to run Flink services by default for production builds.
- Status: VerifyBuild status: build_failed - Key concerns - Maven/artifact location uncertain: unclear whether outputs are placed in /workspace/flink/build-target; if the real artifact is in flink-dist/target, the runtime image could be built from an empty directory. - No explicit production CMD to start Flink; image defaults to an interactive shell. For automated runtime usage, override CMD/ENTRYPOINT. - Build error overview - #0 building with "default" instance using docker driver - #1 [internal] load build definition from Dockerfile - #2 [internal] load metadata for docker.io/library/flink:scala_2.12-java21 - #3 [internal] load .dockerignore - #4 [builder 1/6] FROM docker.io/library/flink:scala_2.12-java21@sha256:55a9a32606e10abc9e7cc0199ecbf901923510b376045c4c6c4fa4e189e122c9 - Base image is flink:scala_2.12-java21 with digest sha256:55a9a32606e10abc9e7cc0199ecbf901923510b376045c4c6c4fa4e189e122c9 - Logs show standard layer pulls (truncated in excerpt) - Base image details - Image: docker.io/library/flink:scala_2.12-java21 - Digest: sha256:55a9a32606e10abc9e7cc0199ecbf901923510b376045c4c6c4fa4e189e122c9 - Recommendations - Verify and align artifact output location (adjust /workspace/flink/build-target vs flink-dist/target) to ensure a non-empty runtime image. - Add an explicit CMD/ENTRYPOINT in the Dockerfile to start Flink for automated runs (or override at runtime). - If this is only for smoke tests, you can keep the interactive shell but plan an override for production deployments.
# Build a Flink distribution from source using the official Flink Java 21 base image
# Stage 1: build from source with Maven (wrapper if present)
FROM flink:scala_2.12-java21 AS builder
# Ensure we are running as root to set up the build environment if needed
USER root
WORKDIR /workspace/flink
# Copy the full repository into the build context
COPY . .
# Ensure Maven wrapper (if present) is executable
RUN if [ -f "./mvnw" ]; then chmod +x ./mvnw; fi
# Build Flink from source for Java 21 using the documented wrapper/profile
RUN set -e; \
if [ -f "./mvnw" ]; then \
./mvnw clean package -DskipTests -Djdk21 -Pjava21-target; \
else \
mvn clean package -DskipTests -Djdk21 -Pjava21-target; \
fi
# Stage 2: Runtime image containing the built distribution
FROM flink:scala_2.12-java21
WORKDIR /workspace/flink
# Copy the built distribution from the builder stage
COPY --from=builder /workspace/flink/build-target /opt/flink
ENV FLINK_HOME=/opt/flink
ENV PATH="$FLINK_HOME/bin:$PATH"
# Ensure correct ownership for the flink user
USER root
RUN chown -R flink:flink /opt/flink
USER flink
# Default to an interactive shell; user can override CMD to run Flink
CMD ["bash"]
Actionable summary
- Status: VerifyBuild status: build_failed
- Key concerns
- Unclear if /workspace/flink/build-target is the top-level Flink distribution root; if build output layout differs, /opt/flink may not expose bin, lib, etc. at expected paths.
- PATH handling risk: ENV PATH line uses quotes; PATH expansion may behave differently. Safer: ENV PATH=/opt/flink/bin:$PATH (no quotes).
- Build/run details
- Docker-based build using image: flink:scala_2.12-java21 (sha256:55a9a32606e10abc9e7cc0199ecbf901923510b376045c4c6c4fa4e189e122c9)
- Dockerfile steps observed:
- [stage-1 2/4] WORKDIR /workspace/flink
- [builder 1/5] FROM flink:scala_2.12-java21
- [builder 2/5] WORKDIR /workspace/flink
- [builder 3/5] COPY . .
- [builder 4/5] RUN if [ -f "./mvnw" ]; then chmod +x ./mvnw; fi
- [builder 5/5] RUN set -e; if [ -f "./mvnw" ]; then ./mvnw clean package -DskipTests -Djdk21 -Pjava21-target; else mvn clean package -DskipTests -Djdk21 -Pjava21-target; fi
- Warnings: Unknown module: jdk.compiler specified to --add-exports (five occurrences)
- Maven activity: [INFO] Scanning for projects...
- Dependency download attempts:
- redhat: https://maven.repository.redhat.com/ga/org/apache/apache/20/apache-20.pom
- central: https://repo.maven.apache.org/maven2/org/apache/apache/20/apache-20.pom
- Progress updates: several small progress messages (4.1 kB, 8.2 kB, 12 kB, 16 kB) followed by [truncated]
- Notable files/paths/versions/commands
- /workspace/flink/build-target (potential top-level root concern)
- /opt/flink (potential install layout)
- Dockerfile (build definition)
- mvnw (optional wrapper)
- mvn (Maven)
- Java target: jdk21
- Maven profile: java21-target
- Outcome
- Build ended with build_failed; final error details not shown in the provided excerpt (log truncated).- Status: VerifyBuild status: build_failed
- Primary concerns
- Final image depends on build output at /workspace/flink/build-target; ensure the Maven build places the distribution there (path must match actual build output).
- ENV PATH line uses PATH expansion; confirm Docker build context supports variable expansion in ENV values as intended.
- FROM image flink:scala_2.12-java21 must exist in the registry used; verify the tag is valid and available.
- Build error details
- Docker build flow:
- #0 building with "default" instance using docker driver
- #1 [internal] load build definition from Dockerfile
- #2 [internal] load metadata for docker.io/library/flink:scala_2.12-java21
- #4 [builder 1/5] FROM docker.io/library/flink:scala_2.12-java21@sha256:55a9a32606e10abc9e7cc0199ecbf901923510b376045c4c6c4fa4e189e122c9
- #5 [stage-1 2/4] WORKDIR /workspace/flink (cached)
- #6 [internal] load build context
- #8 [builder 3/5] COPY . .
- #9 [builder 4/5] RUN if [ -f "./mvnw" ]; then chmod +x ./mvnw; fi
- #10 [builder 5/5] RUN set -e; if [ -f "./mvnw" ]; then ./mvnw clean package -DskipTests -Djdk21 -Pjava21-target; else mvn clean package -DskipTests -Djdk21 -Pjava21-target; fi
- Warnings during build:
- "WARNING: Unknown module: jdk.compiler specified to --add-exports" (repeated several times)
- Maven activity:
- [INFO] Scanning for projects...
- Downloading from redhat: https://maven.repository.redhat.com/ga/org/apache/apache/20/apache-20.pom
- Downloading from central: https://repo.maven.apache.org/maven2/org/apache/apache/20/apache-20.pom
- Progress and downloads continue (truncated in log)
- Outcome: Build ended with status build_failed (no final artifact path shown)
- Artifacts and references
- Working directory: /workspace/flink
- Docker image reference: flink:scala_2.12-java21
- Image digest: sha256:55a9a32606e10abc9e7cc0199ecbf901923510b376045c4c6c4fa4e189e122c9
- Build command used (in Dockerfile): mvnw clean package -DskipTests -Djdk21 -Pjava21-target or mvn clean package -DskipTests -Djdk21 -Pjava21-target
- Suggested next steps
- Verify that the Maven build places the distribution at /workspace/flink/build-target and adjust build output path if needed.
- Confirm Dockerfile ENV PATH expansion works in your CI/build environment.
- Check the availability of flink:scala_2.12-java21 in the target registry (pull manually: docker pull flink:scala_2.12-java21 and verify tag).
- Address jdk.compiler add-exports warnings (update Java options or image as appropriate).
- Re-run the build with verbose Maven output if more details are needed to diagnose the failure.Status: VerifyBuild status: build_failed Key environment and paths - Base image: flink:scala_2.12-java21 (sha256:55a9a32606e10abc9e7cc0199ecbf901923510b376045c4c6c4fa4e189e122c9) - Working directory: /workspace/flink - Expected build output path: /workspace/flink/build-target Commands and flow - COPY . . (builder stage) - If ./mvnw exists: chmod +x ./mvnw; then ./mvnw clean package -DskipTests -Djdk21 -Pjava21-target - Else: mvn clean package -DskipTests -Djdk21 -Pjava21-target - Warnings: Unknown module: jdk.compiler specified to --add-exports (repeated several times) - Build steps include: [builder 4/5] RUN ...; [builder 5/5] RUN set -e; ... with mvn/mvnw execution - Maven repos touched: redhat and central (downloads shown for apache/poms) Actionable issues to fix - Maven availability: Ensure Maven or Maven Wrapper (mvn or mvnw) is present and executable in the builder stage; otherwise the build will fail. - Copy context risk: COPYING the entire repo (COPY . .) may include files not needed for the build or secrets; consider narrowing context or using a .dockerignore. - Build output location: The COPY in stage 2 depends on the Maven output directory being /workspace/flink/build-target. If Maven packaging outputs elsewhere, the COPY will fail. Validate that build-target exists after Maven step and adjust path if needed. Notes - The log shows the build started and dependencies being downloaded from redhat and central repositories; the final result is truncated, with the overall status already marked as build_failed.
# Build a Flink distribution from source using a Maven image as builder
# Stage 1: build from source with Maven (wrapper if present)
FROM maven:3.9.5-eclipse-temurin-21 AS builder
WORKDIR /workspace/flink
# Copy the full repository into the build context
COPY . .
# Ensure Maven wrapper (if present) is executable
RUN if [ -f "./mvnw" ]; then chmod +x ./mvnw; fi
# Build Flink from source for Java 21 using the documented wrapper/profile
RUN set -e; \
if [ -f "./mvnw" ]; then \
./mvnw clean package -DskipTests -Djdk21 -Pjava21-target; \
else \
mvn clean package -DskipTests -Djdk21 -Pjava21-target; \
fi
# Stage 2: Runtime image containing the built distribution
FROM flink:scala_2.12-java21
WORKDIR /workspace/flink
# Copy the built distribution from the builder stage
COPY --from=builder /workspace/flink/build-target ./build-target
ENV FLINK_HOME=/workspace/flink/build-target
ENV PATH=${FLINK_HOME}/bin:${PATH}
# Ownership adjustments
USER root
RUN chown -R flink:flink /workspace/flink
USER flink
# Default to an interactive shell; user can override CMD to run Flink
CMD ["bash"]
Summary (under 1500 chars): - Status: VerifyBuild status: build_failed - Key concerns - Potential FLINK_HOME path mismatch: distribution may be inside subdirectory (e.g., build-target/flink-<version}); ensure FLINK_HOME points to the distribution root. - COPY . . copies entire repo; consider using .dockerignore to exclude .git, build artifacts, etc. - FROM flink:scala_2.12-java21 tag: verify the tag exists in the registry you plan to use. - Failing step - [builder 5/5] RUN set -e; if [ -f "./mvnw" ]; then ./mvnw clean package -DskipTests -Djdk21 -Pjava21-target; else mvn clean package -DskipTests -Djdk21 -Pjava21-target; fi - Exact error - Unknown lifecycle phase "/root/.m2". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. - Exit code: 1 - Context: error occurs after attempting to run Maven in the builder step, causing Docker build to fail with “BUILD FAILURE”. - Missing packages/files - No explicit missing package/file errors; logs show dependency downloads and POM warnings. The problematic artifact path mentioned is the local Maven repo at /root/.m2. - Version/mismatch information - Images/OS: Base: flink:scala_2.12-java21; Builder: maven:3.9.5-eclipse-temurin-21; OS: ubuntu 22.04 (linux-x86_64) - Java target: -Djdk21 -Pjava21-target (Java 21) - Flink project: Flink 2.3-SNAPSHOT - Warnings: multiple “effective model” warnings (duplicate dependencies, artifactId expressions, plugin duplicates); none indicate explicit version/mismatch errors. - Root cause appears to be Maven interpreting /root/.m2 as a lifecycle phase, not a dependency/version issue.
# Build a Flink distribution from source using a Maven image as builder
# Stage 1: build from source with Maven (no wrapper to avoid path issues)
FROM maven:3.9.5-eclipse-temurin-21 AS builder
WORKDIR /workspace/flink
# Copy the full repository into the build context
COPY . .
# Basic Maven setup check
RUN mvn -v
# Build Flink from source for Java 21 using the documented profile
RUN mvn clean package -DskipTests -Pjava21-target -Djdk21
# Stage 2: Runtime image containing the built distribution
FROM flink:scala_2.12-java21
WORKDIR /workspace/flink
# Copy the built distribution from the builder stage
COPY --from=builder /workspace/flink/build-target ./build-target
ENV FLINK_HOME=/workspace/flink/build-target
ENV PATH=/workspace/flink/build-target/bin:${PATH}
# Ownership adjustments
USER root
RUN chown -R flink:flink /workspace/flink
USER flink
# Default to an interactive shell; user can override CMD to run Flink
CMD ["bash"]
- Exact error message and exit code - "ERROR] Failed to execute goal org.apache.rat:apache-rat-plugin:0.13:check (default) on project flink-parent: Too many files with unapproved license: 1 See RAT report in: /workspace/flink/target/rat.txt -> [Help 1]" - Exit code: 1 - Failing command/step - Dockerfile step: RUN mvn clean package -DskipTests -Pjava21-target -Djdk21 - Context: [builder 5/5] phase; ultimately causes BUILD FAILURE - Missing packages or files mentioned - RAT report location: /workspace/flink/target/rat.txt - Unapproved license reported for: Dockerfile (shown as unapproved license in RAT output) - Summary message: Too many files with unapproved license: 1 - Version mismatch / environment details - Base image: flink:scala_2.12-java21 - Builder image: maven:3.9.5-eclipse-temurin-21 - Java target: -Djdk21 (Java 21) - Maven profile: -Pjava21-target - Flink version in project: 2.3-SNAPSHOT - Maven/Java tooling are aligned with Java 21 (Temurin-21); the failure is due to a license-approval issue, not a code/dependency version mismatch.
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Build a Flink distribution from source using a Maven image as builder
# Stage 1: build from source with Maven (no wrapper to avoid path issues)
FROM maven:3.9.5-eclipse-temurin-21 AS builder
WORKDIR /workspace/flink
# Copy the full repository into the build context
COPY . .
# Basic Maven setup check
RUN mvn -v
# Build Flink from source for Java 21 using the documented profile
RUN mvn clean package -DskipTests -Pjava21-target -Djdk21
# Stage 2: Runtime image containing the built distribution
FROM flink:scala_2.12-java21
WORKDIR /workspace/flink
# Copy the built distribution from the builder stage
COPY --from=builder /workspace/flink/build-target ./build-target
ENV FLINK_HOME=/workspace/flink/build-target
ENV PATH=/workspace/flink/build-target/bin:${PATH}
# Ownership adjustments
USER root
RUN chown -R flink:flink /workspace/flink
USER flink
# Default to an interactive shell; user can override CMD to run Flink
CMD ["bash"]
Status: VerifyBuild status: build_failed Actionable items and context: - Potential root causes: - Runtime base image tag flink:scala_2.12-java21 may not exist or be accessible in the registry; verify the tag is valid and reachable. - Building with Maven profiles -Pjava21-target and -Djdk21 relies on the repository's Maven configuration; ensure these profiles exist and build successfully. - FLINK_HOME is set to /workspace/flink/build-target; confirm this is the expected distribution root and that the bin directory is executable after COPY. Key logs and components: - Dockerfile build sequence: - #5 FROM docker.io/library/maven:3.9.5-eclipse-temurin-21@sha256:2bbd188fef2384cf93181bb992b75542a2837afdd5c4c2274cebcae71cd05156 - #6 FROM docker.io/library/flink:scala_2.12-java21@sha256:55a9a32606e10abc9e7cc0199ecbf901923510b376045c4c6c4fa4e189e122c9 - Build environment: - Maven: Apache Maven 3.9.5 - Java: 21.0.1, vendor: Eclipse Adoptium - OS: linux, amd64 - Commands executed: - mvn -v - mvn clean package -DskipTests -Pjava21-target -Djdk21 - Working paths: - /workspace/flink - FLINK_HOME likely /workspace/flink/build-target - Build progress (partial): - Downloading from redhat Maven repository: org/apache/apache/20/apache-20.pom - Downloading from central repository (log truncated) Files, versions, and artifacts: - Base images: maven:3.9.5-eclipse-temurin-21; flink:scala_2.12-java21 - Maven profiles: java21-target; property: -Djdk21 Next steps to resolve: - Confirm flink:scala_2.12-java21 image tag exists in the registry and is accessible. - Inspect the project pom.xml for a profile named java21-target and verify repository configuration supports it. - Verify FLINK_HOME path /workspace/flink/build-target matches expected distribution layout and that the bin directory is executable after COPY.
Concerns
- Base image tag: stage 2 uses flink:scala_2.12-java21; ensure this tag exists and is maintained, otherwise runtime failure.
- Build-target copy: COPY --from=builder /workspace/flink/build-target ./build-target relies on Maven producing /workspace/flink/build-target; if Maven layout changes, the runtime copy may break.
Key steps, commands, and paths
- Multi-stage build:
- Stage-1: FROM docker.io/library/flink:scala_2.12-java21@sha256:55a9a32606e10abc9e7cc0199ecbf901923510b376045c4c6c4fa4e189e122c9
- WORKDIR /workspace/flink
- Builder: FROM docker.io/library/maven:3.9.5-eclipse-temurin-21@sha256:2bbd188fef2384cf93181bb992b75542a2837afdd5c4c2274cebcae71cd05156
- WORKDIR /workspace/flink
- COPY . .
- RUN mvn -v
- RUN mvn clean package -DskipTests -Pjava21-target -Djdk21
- Build context and files:
- Load/build context: 3.95MB
- COPY path: /workspace/flink/build-target
- Maven activity in builder:
- Scanning for projects
- Downloading POMs from central (Apache) and Red Hat repos
- Initial steps shown in log: mvn -v cached, mvn clean package started; log excerpt includes central Maven repo downloads (partial, truncated)
Notes
- The Maven packaging step began and is downloading dependencies; the exact failure cause isn’t shown in the excerpt. Check full logs for the Maven error after the truncated section. If needed, re-run with full logs or enable -X/-e for details.