Skip to content

Commit 3da276d

Browse files
committed
build nifi-opa-plugin from source with workaround
1 parent 9819522 commit 3da276d

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

nifi/Dockerfile

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,28 @@ rm -rf /stackable/nifi-${PRODUCT}/docs
8080
chmod -R g=u /stackable
8181
EOF
8282

83+
FROM stackable/image/java-devel AS opa-authorizer-builder
84+
85+
ARG STACKABLE_USER_UID
86+
ARG PRODUCT
87+
88+
USER ${STACKABLE_USER_UID}
89+
WORKDIR /stackable
90+
91+
COPY --chown=${STACKABLE_USER_UID}:0 nifi/stackable/opa-authorizer/nifi-framework-api-version.patch /stackable/nifi-framework-api-version.patch
92+
93+
# TODO: Set to tag after new release of nifi-opa-plugin
94+
RUN git clone --depth 1 https://github.com/DavidGitter/nifi-opa-plugin.git && \
95+
cd nifi-opa-plugin && \
96+
git reset --hard cdf8c36 && \
97+
git apply /stackable/nifi-framework-api-version.patch && \
98+
cd authorizer && \
99+
mvn \
100+
--batch-mode \
101+
--no-transfer-progress \
102+
install \
103+
-DskipTests
104+
83105
FROM stackable/image/java-base AS final
84106

85107
ARG PRODUCT
@@ -97,6 +119,8 @@ LABEL name="Apache NiFi" \
97119
COPY --chown=${STACKABLE_USER_UID}:0 --from=nifi-builder /stackable/nifi-${PRODUCT} /stackable/nifi-${PRODUCT}/
98120
COPY --chown=${STACKABLE_USER_UID}:0 --from=nifi-builder /stackable/stackable-bcrypt.jar /stackable/stackable-bcrypt.jar
99121

122+
COPY --chown=${STACKABLE_USER_UID}:0 --from=opa-authorizer-builder /stackable/nifi-opa-plugin/authorizer/target/opa-authorizer.nar /stackable/nifi-${PRODUCT}/extensions/opa-authorizer.nar
123+
100124
COPY --chown=${STACKABLE_USER_UID}:0 nifi/stackable/bin /stackable/bin
101125
COPY --chown=${STACKABLE_USER_UID}:0 nifi/licenses /licenses
102126
COPY --chown=${STACKABLE_USER_UID}:0 nifi/python /stackable/python
@@ -127,7 +151,7 @@ ln -s /stackable/nifi-${PRODUCT} /stackable/nifi
127151
chown --no-dereference ${STACKABLE_USER_UID}:0 /stackable/nifi
128152
chmod --recursive g=u /stackable/python
129153
chmod --recursive g=u /stackable/bin
130-
chmod g=u /stackable/nifi-${PRODUCT}
154+
chmod --recursive g=u /stackable/nifi-${PRODUCT}
131155
EOF
132156

133157
# ----------------------------------------

0 commit comments

Comments
 (0)