@@ -25,8 +25,8 @@ microdnf update
2525#
2626# patch: Required for the apply-patches.sh script
2727microdnf install \
28- python-pyyaml \
29- patch
28+ python-pyyaml \
29+ patch
3030
3131microdnf clean all
3232rm -rf /var/cache/yum
@@ -118,23 +118,34 @@ microdnf update
118118microdnf clean all
119119rpm -qa --qf "%{NAME}-%{VERSION}-%{RELEASE}\n " | sort > /stackable/package_manifest.txt
120120chown ${STACKABLE_USER_UID}:0 /stackable/package_manifest.txt
121+ chmod g=u /stackable/package_manifest.txt
121122rm -rf /var/cache/yum
122123
123- chmod -R g=u /stackable/bin
124124ln -sf /stackable/apache-druid-${PRODUCT} /stackable/druid
125125chown -h ${STACKABLE_USER_UID}:0 stackable/druid
126+
126127# Force to overwrite the existing 'run-druid'
127128ln -sf /stackable/bin/run-druid /stackable/druid/bin/run-druid
128129chown -h ${STACKABLE_USER_UID}:0 /stackable/druid/bin/run-druid
130+
131+ # fix missing permissions
132+ chmod -R g=u /stackable/bin
133+ chmod g=u /stackable/apache-druid-${PRODUCT}
129134EOF
130135
131136# ----------------------------------------
132- # Attention:
133- # If you do any file based actions (copying / creating etc.) below this comment you
134- # absolutely need to make sure that the correct permissions are applied!
135- # chown ${STACKABLE_USER_UID}:0
137+ # Checks
138+ # This section is to run final checks to ensure the created final images
139+ # adhere to several minimal requirements like:
140+ # - check file permissions and ownerships
136141# ----------------------------------------
137142
143+ # Check that permissions and ownership in /stackable are set correctly
144+ # This will fail and stop the build if any mismatches are found.
145+ RUN <<EOF
146+ /bin/check-permissions-ownership.sh /stackable ${STACKABLE_USER_UID} 0
147+ EOF
148+
138149USER ${STACKABLE_USER_UID}
139150ENV PATH="${PATH}" :/stackable/druid/bin
140151
0 commit comments