Skip to content

Commit 1d0cc5f

Browse files
committed
chore: fix reproducible build on mac(arm64)
On mac (arm64), Docker defaults to --platform=linux/arm64, while on Linux it defaults to --platform=linux/amd64. These are slightly different. Force Docker to use a single platform/image.
1 parent 589735c commit 1d0cc5f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

standalone-contract/scripts/reproducible_build_docker

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ else
5555
TASKS+=" build "
5656
fi
5757

58-
$DOCKER run --rm $DOCKER_RUN_ARGS -v `pwd`:/code $DOCKER_IMAGE make $TASKS
58+
$DOCKER run --platform=linux/amd64 --rm $DOCKER_RUN_ARGS -v `pwd`:/code $DOCKER_IMAGE make $TASKS
5959
# Reset file ownerships for all files docker might touch
60-
$DOCKER run --rm $DOCKER_RUN_ARGS -e UID=`id -u` -e GID=`id -g` -v `pwd`:/code $DOCKER_IMAGE bash -c 'chown -R -f $UID:$GID checksums.txt build target'
60+
$DOCKER run --platform=linux/amd64 --rm $DOCKER_RUN_ARGS -e UID=`id -u` -e GID=`id -g` -v `pwd`:/code $DOCKER_IMAGE bash -c 'chown -R -f $UID:$GID checksums.txt build target'
6161

6262
if [[ "${UPDATE}" = "yes" ]]; then
6363
echo "${CHECKSUM_FILE_PATH} file is updated with latest binary hashes!"

workspace/scripts/reproducible_build_docker

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ else
5555
TASKS+=" build "
5656
fi
5757

58-
$DOCKER run --rm $DOCKER_RUN_ARGS -v `pwd`:/code $DOCKER_IMAGE make $TASKS
58+
$DOCKER run --platform=linux/amd64 --rm $DOCKER_RUN_ARGS -v `pwd`:/code $DOCKER_IMAGE make $TASKS
5959
# Reset file ownerships for all files docker might touch
60-
$DOCKER run --rm $DOCKER_RUN_ARGS -e UID=`id -u` -e GID=`id -g` -v `pwd`:/code $DOCKER_IMAGE bash -c 'chown -R -f $UID:$GID checksums.txt build target'
60+
$DOCKER run --platform=linux/amd64 --rm $DOCKER_RUN_ARGS -e UID=`id -u` -e GID=`id -g` -v `pwd`:/code $DOCKER_IMAGE bash -c 'chown -R -f $UID:$GID checksums.txt build target'
6161

6262
if [[ "${UPDATE}" = "yes" ]]; then
6363
echo "${CHECKSUM_FILE_PATH} file is updated with latest binary hashes!"

0 commit comments

Comments
 (0)