@@ -19,69 +19,41 @@ RUN microdnf update && \
1919#
2020WORKDIR /tmp
2121RUN if [[ "${PRODUCT}" == 2.* ]] ; then \
22- curl "https://repo.stackable.tech/repository/packages/maven/apache-maven-${MAVEN_VERSION}-bin.tar.gz" | tar -xzC . && \
23- ln -sf /tmp/apache-maven-${MAVEN_VERSION}/bin/mvn /usr/bin/mvn ; \
22+ curl "https://repo.stackable.tech/repository/packages/maven/apache-maven-${MAVEN_VERSION}-bin.tar.gz" | tar -xzC . && \
23+ ln -sf /tmp/apache-maven-${MAVEN_VERSION}/bin/mvn /usr/bin/mvn ; \
2424 fi
2525
2626USER ${STACKABLE_USER_UID}
2727WORKDIR /stackable
2828
2929COPY --chown=${STACKABLE_USER_UID}:0 nifi/stackable/patches /stackable/patches
3030
31- # NOTE: NiFi 1.21.0 source build does not work with the current arm64 git runners due to java heap issues:
32- #
33- # [ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:3.5.0:single (make shared resource) on project nifi-registry-assembly:
34- # Failed to create assembly: Error creating assembly archive bin: Problem creating zip: Execution exception: Java heap space
35- #
36- # Since this will be deprecated in the release 24.7 and then removed we copy the NiFi 1.21.0 binaries instead
37- # of building from source. The if condition can be removed once 1.21.0 is no longer supported and only the
38- # else branch is required to build from source.
39- #
40- RUN if [[ "${PRODUCT}" == "1.21.0" ]] ; then \
41- curl 'https://repo.stackable.tech/repository/m2/tech/stackable/nifi/stackable-bcrypt/1.0-SNAPSHOT/stackable-bcrypt-1.0-20240508.153334-1-jar-with-dependencies.jar' \
42- # This used to be located in /bin/stackable-bcrypt.jar. We create a softlink for /bin/stackable-bcrypt.jar in the main container for backwards compatibility.
43- -o /stackable/stackable-bcrypt.jar && \
44- # zip is different than tar and cannot be just piped, therefore the intermediate save and remove step to unzip
45- curl https://repo.stackable.tech/repository/packages/nifi/nifi-${PRODUCT}-bin.zip -o /stackable/nifi-${PRODUCT}-bin.zip && \
46- unzip /stackable/nifi-${PRODUCT}-bin.zip && \
47- rm /stackable/nifi-${PRODUCT}-bin.zip && \
48- # Remove generated docs in binary
49- rm -rf /stackable/nifi-${PRODUCT}/docs && \
50- # Add Iceberg extensions as they are not included by default and are important enough
51- # They need to be build from source, as https://mvnrepository.com/artifact/org.apache.nifi/nifi-iceberg-processors-nar does not ship the org.apache.hadoop.fs.s3a.S3AFileSystem (see https://github.com/apache/nifi/pull/6368#issuecomment-1502175258)
52- # See https://repo.stackable.tech/repository/packages/nifi/iceberg-nars/README.md for details on how to build them
53- cd /stackable/nifi-${PRODUCT}/lib/ && \
54- curl -O "https://repo.stackable.tech/repository/packages/nifi/iceberg-nars/nifi-iceberg-processors-nar-${PRODUCT}-with-aws.nar" && \
55- curl -O "https://repo.stackable.tech/repository/packages/nifi/iceberg-nars/nifi-iceberg-services-nar-${PRODUCT}-with-aws.nar" && \
56- curl -O "https://repo.stackable.tech/repository/packages/nifi/iceberg-nars/nifi-iceberg-services-api-nar-${PRODUCT}-with-aws.nar" ; \
57- else \
58- curl 'https://repo.stackable.tech/repository/m2/tech/stackable/nifi/stackable-bcrypt/1.0-SNAPSHOT/stackable-bcrypt-1.0-20240508.153334-1-jar-with-dependencies.jar' \
59- # This used to be located in /bin/stackable-bcrypt.jar. We create a softlink for /bin/stackable-bcrypt.jar in the main container for backwards compatibility.
60- -o /stackable/stackable-bcrypt.jar && \
61- # Get the source release from nexus
62- curl "https://repo.stackable.tech/repository/packages/nifi/nifi-${PRODUCT}-source-release.zip" -o "/stackable/nifi-${PRODUCT}-source-release.zip" && \
63- unzip "nifi-${PRODUCT}-source-release.zip" && \
64- # Clean up downloaded source after unzipping
65- rm -rf "nifi-${PRODUCT}-source-release.zip" && \
66- # The NiFi "binary" ends up in a folder named "nifi-${PRODUCT}" which should be copied to /stackable
67- # from /stackable/nifi-${PRODUCT}-src/nifi-assembly/target/nifi-${PRODUCT}-bin/nifi-${PRODUCT} (see later steps)
68- # Therefore we add the suffix "-src" to be able to copy the binary and remove the unzipped sources afterwards.
69- mv nifi-${PRODUCT} nifi-${PRODUCT}-src && \
70- # Apply patches
71- chmod +x patches/apply_patches.sh && \
72- patches/apply_patches.sh ${PRODUCT} && \
73- # Build NiFi
74- cd /stackable/nifi-${PRODUCT}-src/ && \
75- mvn clean install -Dmaven.javadoc.skip=true -DskipTests --activate-profiles include-iceberg,include-hadoop-aws && \
76- # Copy the binaries to the /stackable folder
77- mv /stackable/nifi-${PRODUCT}-src/nifi-assembly/target/nifi-${PRODUCT}-bin/nifi-${PRODUCT} /stackable/nifi-${PRODUCT} && \
78- # Copy the SBOM as well
79- mv /stackable/nifi-${PRODUCT}-src/nifi-assembly/target/bom.json /stackable/nifi-${PRODUCT}/nifi-${PRODUCT}.cdx.json && \
80- # Remove the unzipped sources
81- rm -rf /stackable/nifi-${PRODUCT}-src && \
82- # Remove generated docs in binary
83- rm -rf /stackable/nifi-${PRODUCT}/docs ; \
84- fi
31+ RUN curl 'https://repo.stackable.tech/repository/m2/tech/stackable/nifi/stackable-bcrypt/1.0-SNAPSHOT/stackable-bcrypt-1.0-20240508.153334-1-jar-with-dependencies.jar' \
32+ # This used to be located in /bin/stackable-bcrypt.jar. We create a softlink for /bin/stackable-bcrypt.jar in the main container for backwards compatibility.
33+ -o /stackable/stackable-bcrypt.jar && \
34+ # Get the source release from nexus
35+ curl "https://repo.stackable.tech/repository/packages/nifi/nifi-${PRODUCT}-source-release.zip" -o "/stackable/nifi-${PRODUCT}-source-release.zip" && \
36+ unzip "nifi-${PRODUCT}-source-release.zip" && \
37+ # Clean up downloaded source after unzipping
38+ rm -rf "nifi-${PRODUCT}-source-release.zip" && \
39+ # The NiFi "binary" ends up in a folder named "nifi-${PRODUCT}" which should be copied to /stackable
40+ # from /stackable/nifi-${PRODUCT}-src/nifi-assembly/target/nifi-${PRODUCT}-bin/nifi-${PRODUCT} (see later steps)
41+ # Therefore we add the suffix "-src" to be able to copy the binary and remove the unzipped sources afterwards.
42+ mv nifi-${PRODUCT} nifi-${PRODUCT}-src && \
43+ # Apply patches
44+ chmod +x patches/apply_patches.sh && \
45+ patches/apply_patches.sh ${PRODUCT} && \
46+ # Build NiFi
47+ cd /stackable/nifi-${PRODUCT}-src/ && \
48+ mvn clean install -Dmaven.javadoc.skip=true -DskipTests --activate-profiles include-iceberg,include-hadoop-aws && \
49+ # Copy the binaries to the /stackable folder
50+ mv /stackable/nifi-${PRODUCT}-src/nifi-assembly/target/nifi-${PRODUCT}-bin/nifi-${PRODUCT} /stackable/nifi-${PRODUCT} && \
51+ # Copy the SBOM as well
52+ mv /stackable/nifi-${PRODUCT}-src/nifi-assembly/target/bom.json /stackable/nifi-${PRODUCT}/nifi-${PRODUCT}.cdx.json && \
53+ # Remove the unzipped sources
54+ rm -rf /stackable/nifi-${PRODUCT}-src && \
55+ # Remove generated docs in binary
56+ rm -rf /stackable/nifi-${PRODUCT}/docs
8557
8658FROM stackable/image/java-base AS final
8759
@@ -90,12 +62,12 @@ ARG RELEASE
9062ARG STACKABLE_USER_UID
9163
9264LABEL name="Apache NiFi" \
93- 94- vendor="Stackable GmbH" \
95- version="${PRODUCT}" \
96- release="${RELEASE}" \
97- summary="The Stackable image for Apache NiFi." \
98- description="This image is deployed by the Stackable Operator for Apache NiFi."
65+ 66+ vendor="Stackable GmbH" \
67+ version="${PRODUCT}" \
68+ release="${RELEASE}" \
69+ summary="The Stackable image for Apache NiFi." \
70+ description="This image is deployed by the Stackable Operator for Apache NiFi."
9971
10072COPY --chown=${STACKABLE_USER_UID}:0 --from=nifi-builder /stackable/nifi-${PRODUCT} /stackable/nifi-${PRODUCT}/
10173COPY --chown=${STACKABLE_USER_UID}:0 --from=nifi-builder /stackable/stackable-bcrypt.jar /stackable/stackable-bcrypt.jar
0 commit comments