@@ -69,7 +69,9 @@ RUN curl "https://repo.stackable.tech/repository/packages/hadoop/hadoop-${PRODUC
6969 mv hadoop-dist/target/bom.json /stackable/hadoop-${PRODUCT}/hadoop-${PRODUCT}.cdx.json && \
7070 # HDFS fuse-dfs is not part of the regular dist output, so we need to copy it in ourselves
7171 cp hadoop-hdfs-project/hadoop-hdfs-native-client/target/main/native/fuse-dfs/fuse_dfs /stackable/hadoop-${PRODUCT}/bin && \
72- rm -rf /stackable/hadoop-${PRODUCT}-src
72+ rm -rf /stackable/hadoop-${PRODUCT}-src && \
73+ # Set correct group
74+ chmod -R g=u /stackable
7375
7476# For earlier versions this script removes the .class file that contains the
7577# vulnerable code.
@@ -118,7 +120,9 @@ RUN curl "https://github.com/stackabletech/hdfs-utils/archive/refs/tags/v${HDFS_
118120 mvn --batch-mode --no-transfer-progress clean package -P hadoop-${PRODUCT} -DskipTests -Dmaven.javadoc.skip=true && \
119121 mkdir -p /stackable/hadoop-${PRODUCT}/share/hadoop/common/lib && \
120122 cp target/hdfs-utils-$HDFS_UTILS.jar /stackable/hadoop-${PRODUCT}/share/hadoop/common/lib/hdfs-utils-${HDFS_UTILS}.jar && \
121- rm -rf /stackable/hdfs-utils-main
123+ rm -rf /stackable/hdfs-utils-main && \
124+ # Set correct group
125+ chmod -R g=u /stackable
122126
123127FROM stackable/image/java-base AS final
124128
@@ -128,12 +132,12 @@ ARG HDFS_UTILS
128132ARG STACKABLE_USER_UID
129133
130134LABEL name="Apache Hadoop" \
131- 132- vendor="Stackable GmbH" \
133- version="${PRODUCT}" \
134- release="${RELEASE}" \
135- summary="The Stackable image for Apache Hadoop." \
136- description="This image is deployed by the Stackable Operator for Apache Hadoop / HDFS."
135+ 136+ vendor="Stackable GmbH" \
137+ version="${PRODUCT}" \
138+ release="${RELEASE}" \
139+ summary="The Stackable image for Apache Hadoop." \
140+ description="This image is deployed by the Stackable Operator for Apache Hadoop / HDFS."
137141
138142COPY --chown=${STACKABLE_USER_UID}:0 --from=hadoop-builder /stackable/hadoop-${PRODUCT} /stackable/hadoop-${PRODUCT}/
139143COPY --chown=${STACKABLE_USER_UID}:0 --from=hadoop-builder /stackable/jmx /stackable/jmx/
@@ -159,6 +163,9 @@ microdnf clean all
159163rm -rf /var/cache/yum
160164
161165ln -s /stackable/hadoop-${PRODUCT} /stackable/hadoop
166+
167+ # Set correct group
168+ chmod -R g=u /stackable/fuse_dfs_wrapper
162169mv /stackable/fuse_dfs_wrapper /stackable/hadoop/bin
163170
164171# Remove unneeded binaries:
@@ -179,11 +186,6 @@ find . -name 'hadoop-*tests.jar' -type f -delete
179186# Without this fuse_dfs does not work
180187# It is so non-root users (as we are) can mount a FUSE device and let other users access it
181188echo "user_allow_other" > /etc/fuse.conf
182-
183- # All files and folders owned by root group to support running as arbitrary users.
184- # This is best practice as all container users will belong to the root group (0).
185- chown -R ${STACKABLE_USER_UID}:0 /stackable
186- chmod -R g=u /stackable
187189EOF
188190
189191COPY hadoop/licenses /licenses
0 commit comments