@@ -66,13 +66,13 @@ ARG KCAT
6666ARG STACKABLE_USER_UID
6767
6868LABEL \
69- name="Apache Kafka" \
70- 71- vendor="Stackable GmbH" \
72- version="${PRODUCT}" \
73- release="${RELEASE}" \
74- summary="The Stackable image for Apache Kafka." \
75- description="This image is deployed by the Stackable Operator for Apache Kafka."
69+ name="Apache Kafka" \
70+ 71+ vendor="Stackable GmbH" \
72+ version="${PRODUCT}" \
73+ release="${RELEASE}" \
74+ summary="The Stackable image for Apache Kafka." \
75+ description="This image is deployed by the Stackable Operator for Apache Kafka."
7676
7777COPY --chown=${STACKABLE_USER_UID}:0 --from=kafka-builder /stackable/kafka_${SCALA}-${PRODUCT} /stackable/kafka_${SCALA}-${PRODUCT}
7878COPY --chown=${STACKABLE_USER_UID}:0 --from=kafka-builder /stackable/kafka_${SCALA}-${PRODUCT}.cdx.json /stackable/kafka_${SCALA}-${PRODUCT}/kafka_${SCALA}-${PRODUCT}.cdx.json
@@ -93,6 +93,7 @@ microdnf install \
9393microdnf clean all
9494rpm -qa --qf "%{NAME}-%{VERSION}-%{RELEASE}\n " | sort > /stackable/package_manifest.txt
9595chown ${STACKABLE_USER_UID}:0 /stackable/package_manifest.txt
96+ chmod g=u /stackable/package_manifest.txt
9697rm -rf /var/cache/yum
9798
9899ln -s /stackable/bin/kcat-${KCAT} /stackable/bin/kcat
@@ -102,13 +103,28 @@ ln -s /stackable/bin/kcat /stackable/kcat
102103chown -h ${STACKABLE_USER_UID}:0 /stackable/kcat
103104ln -s /stackable/kafka_${SCALA}-${PRODUCT} /stackable/kafka
104105chown -h ${STACKABLE_USER_UID}:0 /stackable/kafka
106+
107+ # fix missing permissions
108+ chmod g=u /stackable/bin
109+ chmod g=u /stackable/jmx
110+ chmod g=u /stackable/kafka_${SCALA}-${PRODUCT}
111+ EOF
112+
113+ # ----------------------------------------
114+ # Checks
115+ # This section is to run final checks to ensure the created final images
116+ # adhere to several minimal requirements like:
117+ # - check file permissions and ownerships
118+ # ----------------------------------------
119+
120+ # Check that permissions and ownership in /stackable are set correctly
121+ # This will fail and stop the build if any mismatches are found.
122+ RUN <<EOF
123+ /bin/check-permissions-ownership.sh /stackable ${STACKABLE_USER_UID} 0
105124EOF
106125
107126# ----------------------------------------
108- # Attention:
109- # If you do any file based actions (copying / creating etc.) below this comment you
110- # absolutely need to make sure that the correct permissions are applied!
111- # chown ${STACKABLE_USER_UID}:0
127+ # Attention: Do not perform any file based actions (copying/creating etc.) below this comment because the permissions would not be checked.
112128# ----------------------------------------
113129
114130USER ${STACKABLE_USER_UID}
0 commit comments