@@ -191,7 +191,10 @@ FROM stackable/image/java-base AS final
191191
192192ARG PRODUCT
193193ARG RELEASE
194+ ARG TARGETARCH
195+ ARG TARGETOS
194196ARG HDFS_UTILS
197+ ARG ASYNC_PROFILER
195198ARG STACKABLE_USER_UID
196199
197200LABEL \
@@ -203,7 +206,13 @@ LABEL \
203206 summary="The Stackable image for Apache Hadoop." \
204207 description="This image is deployed by the Stackable Operator for Apache Hadoop / HDFS."
205208
206- COPY --chown=${STACKABLE_USER_UID}:0 --from=hadoop-builder /stackable /stackable
209+
210+ COPY --chown=${STACKABLE_USER_UID}:0 --from=hadoop-builder /stackable/hadoop-${PRODUCT}-stackable${RELEASE} /stackable/hadoop-${PRODUCT}-stackable${RELEASE}
211+ COPY --chown=${STACKABLE_USER_UID}:0 --from=hadoop-builder /stackable/hadoop-${PRODUCT}-stackable${RELEASE}-src.tar.gz /stackable/
212+ COPY --chown=${STACKABLE_USER_UID}:0 --from=hadoop-builder /stackable/async-profiler-${ASYNC_PROFILER}-* /stackable/async-profiler-${ASYNC_PROFILER}
213+ COPY --chown=${STACKABLE_USER_UID}:0 --from=hadoop-builder /stackable/jmx /stackable/jmx
214+ COPY --chown=${STACKABLE_USER_UID}:0 --from=hadoop-builder /stackable/protobuf-*-src.tar.gz /stackable/
215+
207216COPY --chown=${STACKABLE_USER_UID}:0 --from=hdfs-utils-builder /stackable/hdfs-utils-${HDFS_UTILS}.jar /stackable/hadoop-${PRODUCT}-stackable${RELEASE}/share/hadoop/common/lib/hdfs-utils-${HDFS_UTILS}.jar
208217COPY --chown=${STACKABLE_USER_UID}:0 --from=hdfs-utils-builder /stackable/hdfs-utils-${HDFS_UTILS}-src.tar.gz /stackable
209218
@@ -230,7 +239,20 @@ rm -rf /var/cache/yum
230239# Without this fuse_dfs does not work
231240# It is so non-root users (as we are) can mount a FUSE device and let other users access it
232241echo "user_allow_other" > /etc/fuse.conf
233- EOF
242+
243+ ln -s "/stackable/hadoop-${PRODUCT}-stackable${RELEASE}" /stackable/hadoop
244+ chown --no-dereference "${STACKABLE_USER_UID}:0" /stackable/hadoop
245+ chmod g=u "/stackable/hadoop-${PRODUCT}-stackable${RELEASE}"
246+ chmod g=u /stackable/*-src.tar.gz
247+
248+ ARCH="${TARGETARCH/amd64/x64}"
249+ mv /stackable/async-profiler-${ASYNC_PROFILER}* "/stackable/async-profiler-${ASYNC_PROFILER-}-${TARGETOS}-${ARCH}"
250+ chmod g=u "/stackable/async-profiler-${ASYNC_PROFILER-}-${TARGETOS}-${ARCH}"
251+ ln -s "/stackable/async-profiler-${ASYNC_PROFILER}-${TARGETOS}-${ARCH}" /stackable/async-profiler
252+ chown --no-dereference "${STACKABLE_USER_UID}:0" /stackable/async-profiler
253+
254+ chmod g=u /stackable/jmx
255+
234256
235257# ----------------------------------------
236258# Checks
241263
242264# Check that permissions and ownership in /stackable are set correctly
243265# This will fail and stop the build if any mismatches are found.
244- RUN <<EOF
245266/bin/check-permissions-ownership.sh /stackable ${STACKABLE_USER_UID} 0
246267EOF
247268
0 commit comments