[
https://issues.apache.org/jira/browse/HADOOP-19807?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18057265#comment-18057265
]
ASF GitHub Bot commented on HADOOP-19807:
-----------------------------------------
aajisaka commented on code in PR #8235:
URL: https://github.com/apache/hadoop/pull/8235#discussion_r2781020580
##########
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:
Can we use bash array to fix the warning?
> Enable cross-platform support for dev container
> -----------------------------------------------
>
> Key: HADOOP-19807
> URL: https://issues.apache.org/jira/browse/HADOOP-19807
> Project: Hadoop Common
> Issue Type: Improvement
> Components: build
> Affects Versions: 3.5.0
> Reporter: Cheng Pan
> Priority: Major
> Labels: pull-request-available
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]