Multiplatform build (ARM64/AMD64) (#41)

* provide -DskipTests argument

* add multiplatform build for testing

* Revert "Revert "Add support for cross-platform builds including linux/amd64 and linux/arm64/v8 (#38)" (#39)"

This reverts commit 92d4cba7a9.

* remove test multiplatform build for PR

---------

Co-authored-by: Jason Baker <jbaker@gosonar.com>
هذا الالتزام موجود في:
Jason Baker
2024-11-28 03:11:45 -06:00
ملتزم من قبل GitHub
الأصل 92d4cba7a9
التزام 74f23a3dd4
2 ملفات معدلة مع 14 إضافات و6 حذوفات

عرض الملف

@@ -4,7 +4,7 @@ WORKDIR /graphhopper
COPY graphhopper .
RUN mvn clean install
RUN mvn clean install -DskipTests
FROM eclipse-temurin:21.0.1_12-jre

عرض الملف

@@ -47,11 +47,19 @@ if [ "$1" ]; then
(cd graphhopper; git checkout --detach "$1")
fi
echo "Building docker image ${imagename}"
docker build . -t "${imagename}"
echo "Creating new builder instance for multi-platform (linux/amd64, linux/arm64/v8) builds to use for building Graphhopper"
docker buildx create --use --name graphhopperbuilder
if [ "${push}" == "false" ]; then
echo "Use \"docker push ${imagename}\" to publish the image on Docker Hub"
if [ "${push}" == "true" ]; then
echo "Building docker image ${imagename} for linux/amd64 and linux/arm64/v8 and pushing to Docker Hub\n"
docker buildx build --platform linux/amd64,linux/arm64/v8 -t "${imagename}" --push .
else
docker push "${imagename}"
echo "Building docker image ${imagename} for linux/amd64 and linux/arm64/v8\n"
docker buildx build --platform linux/amd64,linux/arm64/v8 -t "${imagename}" .
echo "Use \"docker push ${imagename}\" to publish the image on Docker Hub"
fi
# Remove the builder instance after use
docker buildx rm graphhopperbuilder
rm -rf ./graphhopper