@@ -5,8 +5,6 @@ ARG GIT_SYNC
5
5
6
6
FROM oci.stackable.tech/sdp/git-sync/git-sync:${GIT_SYNC} AS git-sync-image
7
7
8
- FROM stackable/image/nifi/iceberg-bundle AS iceberg-bundle-builder
9
-
10
8
FROM stackable/image/java-devel AS nifi-builder
11
9
12
10
ARG PRODUCT
@@ -85,6 +83,78 @@ rm -rf /stackable/nifi-${PRODUCT}/docs
85
83
chmod -R g=u /stackable
86
84
EOF
87
85
86
+ FROM stackable/image/java-devel AS nifi-iceberg-bundle-builder
87
+
88
+ ARG NIFI_ICEBERG_BUNDLE
89
+ ARG PRODUCT
90
+ ARG STACKABLE_USER_UID
91
+
92
+ USER ${STACKABLE_USER_UID}
93
+ WORKDIR /build
94
+
95
+ RUN <<EOF
96
+ mkdir -p /stackable
97
+
98
+ # NiFI 1.x natively supports Iceberg, no need to build an iceberg-bundle for it
99
+ if [[ "${PRODUCT}" != 1.* ]] ; then
100
+ curl -L "https://github.com/stackabletech/nifi-iceberg-bundle/archive/refs/tags/${NIFI_ICEBERG_BUNDLE}.tar.gz" | tar -xzC .
101
+ cd nifi-iceberg-bundle-${NIFI_ICEBERG_BUNDLE} || exit
102
+
103
+ sed -i -e "s/{{ NIFI_VERSION }}/${PRODUCT}/g" pom.xml
104
+
105
+ mvn \
106
+ --batch-mode \
107
+ --no-transfer-progress\
108
+ clean package \
109
+ -D nifi.version=${PRODUCT} \
110
+ -Dmaven.javadoc.skip=true \
111
+ -Denforcer.skip=true
112
+ # We need "-Denforcer.skip=true", as the Maven version is too old
113
+
114
+ cp ./nifi-iceberg-services-api-nar/target/nifi-iceberg-services-api-nar-${NIFI_ICEBERG_BUNDLE}.nar /stackable
115
+ cp ./nifi-iceberg-services-nar/target/nifi-iceberg-services-nar-${NIFI_ICEBERG_BUNDLE}.nar /stackable
116
+ cp ./nifi-iceberg-processors-nar/target/nifi-iceberg-processors-nar-${NIFI_ICEBERG_BUNDLE}.nar /stackable
117
+ cp ./target/bom.json /stackable/nifi-iceberg-bundle.cdx.json
118
+
119
+ cd ..
120
+ # Save disk space, even for intermediate images
121
+ rm -rf nifi-iceberg-bundle-${NIFI_ICEBERG_BUNDLE}
122
+
123
+ # Set correct groups
124
+ chmod g=u /stackable/*.nar
125
+ chmod g=u /stackable/*.cdx.json
126
+ fi
127
+ EOF
128
+
129
+ FROM stackable/image/java-devel AS opa-authorizer-builder
130
+
131
+ ARG NIFI_OPA_AUTHORIZER_PLUGIN
132
+ ARG STACKABLE_USER_UID
133
+ ARG PRODUCT
134
+
135
+ USER ${STACKABLE_USER_UID}
136
+ WORKDIR /build
137
+
138
+ RUN <<EOF
139
+ mkdir -p /stackable
140
+
141
+ curl -L "https://github.com/DavidGitter/nifi-opa-plugin/archive/refs/tags/v${NIFI_OPA_AUTHORIZER_PLUGIN}.tar.gz" | tar -xzC .
142
+ cd nifi-opa-plugin-${NIFI_OPA_AUTHORIZER_PLUGIN}/authorizer || exit
143
+
144
+ mvn \
145
+ --batch-mode \
146
+ --no-transfer-progress \
147
+ clean package \
148
+ -DskipTests \
149
+ -Pnifi-${PRODUCT}
150
+
151
+ cp ./target/opa-authorizer.nar /stackable/opa-authorizer.nar
152
+ cp ../LICENSE /stackable/LICENSE
153
+
154
+ # Set correct permissions
155
+ chmod g=u /stackable/opa-authorizer.nar
156
+ EOF
157
+
88
158
FROM stackable/image/java-base AS final
89
159
90
160
ARG PRODUCT
@@ -101,11 +171,12 @@ LABEL name="Apache NiFi" \
101
171
102
172
COPY --chown=${STACKABLE_USER_UID}:0 --from=nifi-builder /stackable/nifi-${PRODUCT} /stackable/nifi-${PRODUCT}/
103
173
COPY --chown=${STACKABLE_USER_UID}:0 --from=nifi-builder /stackable/stackable-bcrypt.jar /stackable/stackable-bcrypt.jar
104
- COPY --chown=${STACKABLE_USER_UID}:0 --from=iceberg-bundle-builder /stackable/*.nar /stackable/nifi-${PRODUCT}/lib/
105
- COPY --chown=${STACKABLE_USER_UID}:0 --from=iceberg-bundle-builder /stackable/*.sbom.json /stackable/nifi-${PRODUCT}/lib/
106
-
174
+ COPY --chown=${STACKABLE_USER_UID}:0 --from=nifi-iceberg-bundle-builder /stackable/*.nar /stackable/nifi-${PRODUCT}/lib/
175
+ COPY --chown=${STACKABLE_USER_UID}:0 --from=nifi-iceberg-bundle-builder /stackable/*.cdx.json /stackable/nifi-${PRODUCT}/lib/
107
176
COPY --chown=${STACKABLE_USER_UID}:0 --from=nifi-builder /stackable/git-sync /stackable/git-sync
108
177
178
+ COPY --chown=${STACKABLE_USER_UID}:0 --from=opa-authorizer-builder /stackable/opa-authorizer.nar /stackable/nifi-${PRODUCT}/extensions/opa-authorizer.nar
179
+ COPY --chown=${STACKABLE_USER_UID}:0 --from=opa-authorizer-builder /stackable/LICENSE /licenses/NIFI_OPA_PLUGIN_LICENSE
109
180
COPY --chown=${STACKABLE_USER_UID}:0 nifi/stackable/bin /stackable/bin
110
181
COPY --chown=${STACKABLE_USER_UID}:0 nifi/licenses /licenses
111
182
COPY --chown=${STACKABLE_USER_UID}:0 nifi/python /stackable/python
0 commit comments