Skip to content

Commit c80ae9a

Browse files
Use check permissions script and consolidation (#1055)
* use check permissions script and consolidation * adapted changelog * Update spark-k8s/Dockerfile Co-authored-by: Siegfried Weber <[email protected]> --------- Co-authored-by: Siegfried Weber <[email protected]>
1 parent ceaa1cd commit c80ae9a

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ All notable changes to this project will be documented in this file.
2323
`check-permissions-ownership.sh` provided in stackable-base image ([#1027]).
2424
- opa: check for correct permissions and ownerships in /stackable folder via
2525
`check-permissions-ownership.sh` provided in stackable-base image ([#1038]).
26+
- spark-k8s: check for correct permissions and ownerships in /stackable folder via
27+
`check-permissions-ownership.sh` provided in stackable-base image ([#1055]).
2628
- superset: check for correct permissions and ownerships in /stackable folder via
2729
`check-permissions-ownership.sh` provided in stackable-base image ([#1053]).
2830
- trino: check for correct permissions and ownerships in /stackable folder via
@@ -64,6 +66,7 @@ All notable changes to this project will be documented in this file.
6466
[#1050]: https://github.com/stackabletech/docker-images/pull/1050
6567
[#1053]: https://github.com/stackabletech/docker-images/pull/1053
6668
[#1054]: https://github.com/stackabletech/docker-images/pull/1054
69+
[#1055]: https://github.com/stackabletech/docker-images/pull/1055
6770

6871
## [25.3.0] - 2025-03-21
6972

spark-k8s/Dockerfile

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -333,17 +333,31 @@ 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
340+
chmod g=u /stackable/run-spark.sh
336341
EOF
337342

343+
# ----------------------------------------
344+
# Checks
345+
# This section is to run final checks to ensure the created final images
346+
# adhere to several minimal requirements like:
347+
# - check file permissions and ownerships
348+
# ----------------------------------------
349+
350+
# Check that permissions and ownership in /stackable are set correctly
351+
# This will fail and stop the build if any mismatches are found.
352+
RUN <<EOF
353+
/bin/check-permissions-ownership.sh /stackable ${STACKABLE_USER_UID} 0
354+
EOF
338355

339356
# ----------------------------------------
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
357+
# Attention: Do not perform any file based actions (copying/creating etc.) below this comment because the permissions would not be checked.
344358
# ----------------------------------------
345359

346360
USER ${STACKABLE_USER_UID}
347361

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

0 commit comments

Comments
 (0)