Skip to content

Commit

Permalink
Allow user to define BUILDPLATFORM to build Docker image (#3038)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbonofre authored Jul 23, 2024
1 parent d6f7a4f commit 85f99b0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,9 @@ do
echo "RUN mkdir -p /home/$USER_NAME/.m2/repository"
} > Dockerfile

export BUILDPLATFORM=$(docker info --format "{{.OSType}}/{{.Architecture}}")
if [ -z "$BUILDPLATFORM" ]; then
export BUILDPLATFORM=$(docker info --format "{{.OSType}}/{{.Architecture}}")
fi
# Include the ruby gemspec for preinstallation.
# shellcheck disable=SC2086
tar -cf- Dockerfile $DOCKER_EXTRA_CONTEXT | DOCKER_BUILDKIT=1 docker build $DOCKER_BUILD_XTRA_ARGS --build-arg="BUILDPLATFORM=${BUILDPLATFORM}" -t "$DOCKER_IMAGE_NAME" -
Expand Down

0 comments on commit 85f99b0

Please sign in to comment.