@@ -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,14 @@ 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+ #  TODO ARCH & symlink
213+ COPY  --chown=${STACKABLE_USER_UID}:0 --from=hadoop-builder /stackable/async-profiler-${ASYNC_PROFILER}-* /stackable/async-profiler-${ASYNC_PROFILER}
214+ COPY  --chown=${STACKABLE_USER_UID}:0 --from=hadoop-builder /stackable/jmx /stackable/jmx
215+ COPY  --chown=${STACKABLE_USER_UID}:0 --from=hadoop-builder /stackable/protobuf-*-src.tar.gz /stackable/
216+ 
207217COPY  --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
208218COPY  --chown=${STACKABLE_USER_UID}:0 --from=hdfs-utils-builder /stackable/hdfs-utils-${HDFS_UTILS}-src.tar.gz /stackable
209219
@@ -230,7 +240,20 @@ rm -rf /var/cache/yum
230240#  Without this fuse_dfs does not work
231241#  It is so non-root users (as we are) can mount a FUSE device and let other users access it
232242echo "user_allow_other"  > /etc/fuse.conf
233- EOF
243+ 
244+ ln -s /stackable/hadoop-${PRODUCT}-stackable${RELEASE} /stackable/hadoop
245+ chown --no-dereference ${STACKABLE_USER_UID}:0 /stackable/hadoop
246+ chmod g=u /stackable/hadoop-${PRODUCT}-stackable${RELEASE}
247+ chmod g=u /stackable/*-src.tar.gz
248+ 
249+ ARCH="${TARGETARCH/amd64/x64}" 
250+ mv /stackable/async-profiler-${ASYNC_PROFILER}* /stackable/async-profiler-${ASYNC_PROFILER-}-${TARGETOS}-${ARCH}
251+ chmod g=u /stackable/async-profiler-${ASYNC_PROFILER-}-${TARGETOS}-${ARCH}
252+ ln -s "/stackable/async-profiler-${ASYNC_PROFILER}-${TARGETOS}-${ARCH}"  /stackable/async-profiler
253+ chown --no-dereference ${STACKABLE_USER_UID}:0 /stackable/async-profiler
254+ 
255+ chmod g=u /stackable/jmx
256+ 
234257
235258#  ----------------------------------------
236259#  Checks
241264
242265#  Check that permissions and ownership in /stackable are set correctly
243266#  This will fail and stop the build if any mismatches are found.
244- RUN  <<EOF
245267/bin/check-permissions-ownership.sh /stackable ${STACKABLE_USER_UID} 0
246268EOF
247269
0 commit comments