Skip to content

Commit 59c6141

Browse files
committed
consolidation
1 parent c99ee58 commit 59c6141

File tree

1 file changed

+31
-18
lines changed

1 file changed

+31
-18
lines changed

zookeeper/Dockerfile

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -60,39 +60,52 @@ ARG RELEASE
6060
ARG STACKABLE_USER_UID
6161

6262
LABEL \
63-
name="Apache ZooKeeper" \
64-
maintainer="[email protected]" \
65-
vendor="Stackable GmbH" \
66-
version="${PRODUCT}" \
67-
release="${RELEASE}" \
68-
summary="The Stackable image for Apache ZooKeeper." \
69-
description="This image is deployed by the Stackable Operator for Apache ZooKeeper."
63+
name="Apache ZooKeeper" \
64+
maintainer="[email protected]" \
65+
vendor="Stackable GmbH" \
66+
version="${PRODUCT}" \
67+
release="${RELEASE}" \
68+
summary="The Stackable image for Apache ZooKeeper." \
69+
description="This image is deployed by the Stackable Operator for Apache ZooKeeper."
70+
71+
# Copy over the ZooKeeper binary folder
72+
COPY --chown=${STACKABLE_USER_UID}:0 --from=builder /stackable/apache-zookeeper-${PRODUCT}-bin /stackable/apache-zookeeper-${PRODUCT}-bin/
73+
COPY --chown=${STACKABLE_USER_UID}:0 --from=builder /stackable/jmx /stackable/jmx/
74+
COPY zookeeper/licenses /licenses
7075

7176
RUN <<EOF
7277
microdnf update
7378
microdnf clean all
7479
rpm -qa --qf "%{NAME}-%{VERSION}-%{RELEASE}\n" | sort > /stackable/package_manifest.txt
7580
chown ${STACKABLE_USER_UID}:0 /stackable/package_manifest.txt
81+
chmod g=u /stackable/package_manifest.txt
7682
rm -rf /var/cache/yum
77-
EOF
78-
79-
# Copy over the ZooKeeper binary folder
80-
COPY --chown=${STACKABLE_USER_UID}:0 --from=builder /stackable/apache-zookeeper-${PRODUCT}-bin /stackable/apache-zookeeper-${PRODUCT}-bin/
81-
COPY --chown=${STACKABLE_USER_UID}:0 --from=builder /stackable/jmx /stackable/jmx/
82-
COPY zookeeper/licenses /licenses
8383

8484
# Add link pointing from /stackable/zookeeper to /stackable/apache-zookeeper-${PRODUCT}-bin/
8585
# to preserve the folder name with the version.
86-
RUN <<EOF
8786
ln -s /stackable/apache-zookeeper-${PRODUCT}-bin/ /stackable/zookeeper
8887
chown -h ${STACKABLE_USER_UID}:0 /stackable/zookeeper
88+
89+
# fix missing permissions
90+
chmod g=u /stackable/jmx
91+
chmod g=u /stackable/apache-zookeeper-${PRODUCT}-bin/
92+
EOF
93+
94+
# ----------------------------------------
95+
# Checks
96+
# This section is to run final checks to ensure the created final images
97+
# adhere to several minimal requirements like:
98+
# - check file permissions and ownerships
99+
# ----------------------------------------
100+
101+
# Check that permissions and ownership in /stackable are set correctly
102+
# This will fail and stop the build if any mismatches are found.
103+
RUN <<EOF
104+
/bin/check-permissions-ownership.sh /stackable ${STACKABLE_USER_UID} 0
89105
EOF
90106

91107
# ----------------------------------------
92-
# Attention:
93-
# If you do any file based actions (copying / creating etc.) below this comment you
94-
# absolutely need to make sure that the correct permissions are applied!
95-
# chown ${STACKABLE_USER_UID}:0
108+
# Attention: Do not perform any file based actions (copying/creating etc.) below this comment because the permissions would not be checked.
96109
# ----------------------------------------
97110

98111
ENV ZOOKEEPER_HOME=/stackable/zookeeper

0 commit comments

Comments
 (0)