Skip to content

Commit 569b5ce

Browse files
committed
docker/run_dockers: allow specifying the architecture
Allow users to build for a different architecture if they'd like. Right now, the Docker images only support amd64 and arm64, but it's possible that we could support more images in the future.
1 parent e817947 commit 569b5ce

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

docker/run_dockers.bsh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,12 @@ function split_image_name()
4343
# Parse Arguments
4444
IMAGES=()
4545
PRUNE=
46-
while [[ $# > 0 ]]; do
46+
ARCH=amd64
47+
while [[ $# -gt 0 ]]; do
4748
if [ "$1" = "--prune" ]; then
4849
PRUNE=t
50+
elif [[ "$1" == --arch=* ]]; then
51+
ARCH="${1#--arch=}"
4952
elif [ "$1" == "--" ]; then
5053
shift
5154
DOCKER_CMD="${@}"
@@ -109,6 +112,7 @@ for IMAGE_NAME in "${IMAGES[@]}"; do
109112
-e FINAL_GID=${FINAL_GID} \
110113
-v "${MINGW_PATCH}${REPO_DIR}:/src" \
111114
-v "${MINGW_PATCH}${IMAGE_REPO_DIR}:/repo" \
115+
--platform "$ARCH" \
112116
gitlfs/build-dockers:${IMAGE_NAME} ${DOCKER_CMD-}
113117

114118
if [ -n "$PRUNE" ]

0 commit comments

Comments
 (0)