Skip to content

Commit cb45142

Browse files
committed
Merge branch 'main' of https://github.com/stackabletech/docker-images into feat/modularize-dockerfiles
2 parents d6c30a6 + b87b5cc commit cb45142

File tree

5 files changed

+83
-51
lines changed

5 files changed

+83
-51
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ All notable changes to this project will be documented in this file.
3838
`check-permissions-ownership.sh` provided in stackable-base image ([#1025]).
3939
- zookeeper: check for correct permissions and ownerships in /stackable folder via
4040
`check-permissions-ownership.sh` provided in stackable-base image ([#1043]).
41+
- nifi: Build and add OPA authorizer plugin nar ([#1058]).
42+
- nifi: Add [nifi-iceberg-bundle](https://github.com/stackabletech/nifi-iceberg-bundle) for NiFi `2.2.0` ([#1060], [#1106]).
4143
- java: Add JDK 24 ([#1097]).
4244
- ci: Add golang image to mirror workflow ([#1103]).
4345
- omid: bump version to 1.1.3 ([#1105])
@@ -111,6 +113,7 @@ All notable changes to this project will be documented in this file.
111113
[#1054]: https://github.com/stackabletech/docker-images/pull/1054
112114
[#1055]: https://github.com/stackabletech/docker-images/pull/1055
113115
[#1056]: https://github.com/stackabletech/docker-images/pull/1056
116+
[#1058]: https://github.com/stackabletech/docker-images/pull/1058
114117
[#1060]: https://github.com/stackabletech/docker-images/pull/1060
115118
[#1090]: https://github.com/stackabletech/docker-images/pull/1090
116119
[#1091]: https://github.com/stackabletech/docker-images/pull/1091

nifi/Dockerfile

Lines changed: 76 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ ARG GIT_SYNC
55

66
FROM oci.stackable.tech/sdp/git-sync/git-sync:${GIT_SYNC} AS git-sync-image
77

8-
FROM stackable/image/nifi/iceberg-bundle AS iceberg-bundle-builder
9-
108
FROM stackable/image/java-devel AS nifi-builder
119

1210
ARG PRODUCT
@@ -85,6 +83,78 @@ rm -rf /stackable/nifi-${PRODUCT}/docs
8583
chmod -R g=u /stackable
8684
EOF
8785

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+
88158
FROM stackable/image/java-base AS final
89159

90160
ARG PRODUCT
@@ -101,11 +171,12 @@ LABEL name="Apache NiFi" \
101171

102172
COPY --chown=${STACKABLE_USER_UID}:0 --from=nifi-builder /stackable/nifi-${PRODUCT} /stackable/nifi-${PRODUCT}/
103173
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/
107176
COPY --chown=${STACKABLE_USER_UID}:0 --from=nifi-builder /stackable/git-sync /stackable/git-sync
108177

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
109180
COPY --chown=${STACKABLE_USER_UID}:0 nifi/stackable/bin /stackable/bin
110181
COPY --chown=${STACKABLE_USER_UID}:0 nifi/licenses /licenses
111182
COPY --chown=${STACKABLE_USER_UID}:0 nifi/python /stackable/python

nifi/iceberg-bundle/Dockerfile

Lines changed: 0 additions & 38 deletions
This file was deleted.

nifi/iceberg-bundle/versions.py

Lines changed: 0 additions & 7 deletions
This file was deleted.

nifi/versions.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,21 @@
44
"java-base": "11",
55
"java-devel": "11", # There is an error when trying to use the jdk 21 (since nifi 1.26.0)
66
"git_sync": "v4.4.0",
7+
"nifi_opa_authorizer_plugin": "0.1.0",
78
},
89
{
910
"product": "1.28.1",
1011
"java-base": "11",
1112
"java-devel": "11",
1213
"git_sync": "v4.4.0",
14+
"nifi_opa_authorizer_plugin": "0.1.0",
1315
},
1416
{
1517
"product": "2.4.0",
1618
"java-base": "21",
1719
"java-devel": "21",
18-
"nifi/iceberg-bundle": "0.0.4",
1920
"git_sync": "v4.4.0",
21+
"nifi_iceberg_bundle": "0.0.4",
22+
"nifi_opa_authorizer_plugin": "0.1.0",
2023
},
2124
]

0 commit comments

Comments
 (0)