Skip to content

Commit 19782d3

Browse files
committed
use check permissions script
1 parent 1a34ea1 commit 19782d3

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

druid/Dockerfile

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ microdnf update
2525
#
2626
# patch: Required for the apply-patches.sh script
2727
microdnf install \
28-
python-pyyaml \
29-
patch
28+
python-pyyaml \
29+
patch
3030

3131
microdnf clean all
3232
rm -rf /var/cache/yum
@@ -118,23 +118,34 @@ microdnf update
118118
microdnf clean all
119119
rpm -qa --qf "%{NAME}-%{VERSION}-%{RELEASE}\n" | sort > /stackable/package_manifest.txt
120120
chown ${STACKABLE_USER_UID}:0 /stackable/package_manifest.txt
121+
chmod g=u /stackable/package_manifest.txt
121122
rm -rf /var/cache/yum
122123

123-
chmod -R g=u /stackable/bin
124124
ln -sf /stackable/apache-druid-${PRODUCT} /stackable/druid
125125
chown -h ${STACKABLE_USER_UID}:0 stackable/druid
126+
126127
# Force to overwrite the existing 'run-druid'
127128
ln -sf /stackable/bin/run-druid /stackable/druid/bin/run-druid
128129
chown -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}
129134
EOF
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+
138149
USER ${STACKABLE_USER_UID}
139150
ENV PATH="${PATH}":/stackable/druid/bin
140151

0 commit comments

Comments
 (0)