@@ -333,17 +333,30 @@ ln -s /usr/bin/pip-${PYTHON} /usr/bin/pip
333333# Symlink example jar, so that we can easily use it in tests
334334ln -s /stackable/spark/examples/jars/spark-examples_*.jar /stackable/spark/examples/jars/spark-examples.jar
335335chown -h ${STACKABLE_USER_UID}:0 /stackable/spark/examples/jars/spark-examples.jar
336+
337+ # fix permissions
338+ chmod g=u /stackable/spark
339+ chmod g=u /stackable/jmx
336340EOF
337341
342+ # ----------------------------------------
343+ # Checks
344+ # This section is to run final checks to ensure the created final images
345+ # adhere to several minimal requirements like:
346+ # - check file permissions and ownerships
347+ # ----------------------------------------
348+
349+ # Check that permissions and ownership in /stackable are set correctly
350+ # This will fail and stop the build if any mismatches are found.
351+ RUN <<EOF
352+ /bin/check-permissions-ownership.sh /stackable ${STACKABLE_USER_UID} 0
353+ EOF
338354
339355# ----------------------------------------
340- # Attention:
341- # If you do any file based actions (copying / creating etc.) below this comment you
342- # absolutely need to make sure that the correct permissions are applied!
343- # chown ${STACKABLE_USER_UID}:0
356+ # Attention: Do not perform any file based actions (copying/creating etc.) below this comment because the permissions would not be checked.
344357# ----------------------------------------
345358
346359USER ${STACKABLE_USER_UID}
347360
348- WORKDIR /stackable/spark
361+ WORKDIR ${SPARK_HOME}
349362ENTRYPOINT [ "/stackable/run-spark.sh" ]
0 commit comments