diff --git a/CHANGELOG.md b/CHANGELOG.md index d45febf4f..4e7aacf36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ All notable changes to this project will be documented in this file. `check-permissions-ownership.sh` provided in stackable-base image ([#1029]). - hbase: check for correct permissions and ownerships in /stackable folder via `check-permissions-ownership.sh` provided in stackable-base image ([#1028]). +- druid: check for correct permissions and ownerships in /stackable folder via + `check-permissions-ownership.sh` provided in stackable-base image ([#1039]). - spark-connect-client: A new image for Spark connect tests and demos ([#1034]) - nifi: check for correct permissions and ownerships in /stackable folder via `check-permissions-ownership.sh` provided in stackable-base image ([#1027]). @@ -27,6 +29,7 @@ All notable changes to this project will be documented in this file. - hadoop: reduce docker image size by removing the recursive chown/chmods in the final image ([#1029]). - hbase: reduce docker image size by removing the recursive chown/chmods in the final image ([#1028]). +- druid: reduce docker image size by removing the recursive chown/chmods in the final image ([#1039]). - nifi: reduce docker image size by removing the recursive chown/chmods in the final image ([#1027]). - opa: reduce docker image size by removing the recursive chown/chmods in the final image ([#1038]). - spark-k8s: reduce docker image size by removing the recursive chown/chmods in the final image ([#1042]). @@ -39,6 +42,7 @@ All notable changes to this project will be documented in this file. [#1029]: https://github.com/stackabletech/docker-images/pull/1029 [#1034]: https://github.com/stackabletech/docker-images/pull/1034 [#1038]: https://github.com/stackabletech/docker-images/pull/1038 +[#1039]: https://github.com/stackabletech/docker-images/pull/1039 [#1042]: https://github.com/stackabletech/docker-images/pull/1042 [#1044]: https://github.com/stackabletech/docker-images/pull/1044 [#1050]: https://github.com/stackabletech/docker-images/pull/1050 diff --git a/druid/Dockerfile b/druid/Dockerfile index de5137591..8e7bcc6a4 100644 --- a/druid/Dockerfile +++ b/druid/Dockerfile @@ -25,8 +25,8 @@ microdnf update # # patch: Required for the apply-patches.sh script microdnf install \ -python-pyyaml \ -patch + python-pyyaml \ + patch microdnf clean all rm -rf /var/cache/yum @@ -47,9 +47,9 @@ COPY --chown=stackable:0 druid/stackable/patches/${PRODUCT} /stackable/apache-dr # are still working in the cache directory. RUN --mount=type=cache,id=maven-${PRODUCT},uid=${STACKABLE_USER_UID},target=/stackable/.m2/repository \ - --mount=type=cache,id=npm-${PRODUCT},uid=${STACKABLE_USER_UID},target=/stackable/.npm \ - --mount=type=cache,id=cache-${PRODUCT},uid=${STACKABLE_USER_UID},target=/stackable/.cache \ - < /stackable/package_manifest.txt +chown ${STACKABLE_USER_UID}:0 /stackable/package_manifest.txt +chmod g=u /stackable/package_manifest.txt rm -rf /var/cache/yum -ln -s /stackable/apache-druid-${PRODUCT} /stackable/druid +ln -sf /stackable/apache-druid-${PRODUCT} /stackable/druid +chown -h ${STACKABLE_USER_UID}:0 stackable/druid # Force to overwrite the existing 'run-druid' ln -sf /stackable/bin/run-druid /stackable/druid/bin/run-druid +chown -h ${STACKABLE_USER_UID}:0 /stackable/druid/bin/run-druid -# All files and folders owned by root group to support running as arbitrary users. -# This is best practice as all container users will belong to the root group (0). -chown -R ${STACKABLE_USER_UID}:0 /stackable -chmod -R g=u /stackable +# fix missing permissions +chmod -R g=u /stackable/bin +chmod g=u /stackable/apache-druid-${PRODUCT} EOF # ---------------------------------------- -# Attention: We are changing the group of all files in /stackable directly above -# If you do any file based actions (copying / creating etc.) below this comment you -# absolutely need to make sure that the correct permissions are applied! -# chown ${STACKABLE_USER_UID}:0 +# Checks +# This section is to run final checks to ensure the created final images +# adhere to several minimal requirements like: +# - check file permissions and ownerships +# ---------------------------------------- + +# Check that permissions and ownership in /stackable are set correctly +# This will fail and stop the build if any mismatches are found. +RUN <