Skip to content

Commit 2caffc3

Browse files
committed
use check permissions script and consolidation
1 parent b2cec4c commit 2caffc3

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

spark-k8s/Dockerfile

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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
334334
ln -s /stackable/spark/examples/jars/spark-examples_*.jar /stackable/spark/examples/jars/spark-examples.jar
335335
chown -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
336340
EOF
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

346359
USER ${STACKABLE_USER_UID}
347360

348-
WORKDIR /stackable/spark
361+
WORKDIR ${SPARK_HOME}
349362
ENTRYPOINT [ "/stackable/run-spark.sh" ]

0 commit comments

Comments
 (0)