pan3793 commented on code in PR #8235:
URL: https://github.com/apache/hadoop/pull/8235#discussion_r2777464892


##########
start-build-env.sh:
##########
@@ -35,17 +36,20 @@ fi
 DOCKER_DIR=dev-support/docker
 DOCKER_FILE="${DOCKER_DIR}/Dockerfile${OS_PLATFORM_SUFFIX}"
 
-CPU_ARCH=$(echo "$MACHTYPE" | cut -d- -f1)
-if [[ "$CPU_ARCH" == "aarch64" || "$CPU_ARCH" == "arm64" ]]; then
+CPU_ARCH=${CPU_ARCH:-$(uname -m)}
+if [[ "$CPU_ARCH" == "x86_64" || "$CPU_ARCH" == "amd64" ]]; then
+  DOCKER_PLATFORM_ARGS="--platform linux/amd64"
+elif [[ "$CPU_ARCH" == "aarch64" || "$CPU_ARCH" == "arm64" ]]; then
   DOCKER_FILE="${DOCKER_DIR}/Dockerfile${OS_PLATFORM_SUFFIX}_aarch64"
+  DOCKER_PLATFORM_ARGS="--platform linux/arm64"
 fi
 
 if [ ! -e "${DOCKER_FILE}" ] ; then
   echo "'${OS_PLATFORM}' environment not available yet for '${CPU_ARCH}'"
   exit 1
 fi
 
-docker build -t hadoop-build -f $DOCKER_FILE $DOCKER_DIR
+docker build ${DOCKER_PLATFORM_ARGS} -t hadoop-build -f "${DOCKER_FILE}" 
"${DOCKER_DIR}"

Review Comment:
   shellcheck complains "start-build-env.sh:52:14: note: Double quote to 
prevent globbing and word splitting. [SC2086]", but this is intended, as it is 
composed of multiple arguments.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to