Skip to content

Commit 74f23a3

Browse files
authored
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 92d4cba. * remove test multiplatform build for PR --------- Co-authored-by: Jason Baker <[email protected]>
1 parent 92d4cba commit 74f23a3

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ WORKDIR /graphhopper
44

55
COPY graphhopper .
66

7-
RUN mvn clean install
7+
RUN mvn clean install -DskipTests
88

99
FROM eclipse-temurin:21.0.1_12-jre
1010

build.sh

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,19 @@ if [ "$1" ]; then
4747
(cd graphhopper; git checkout --detach "$1")
4848
fi
4949

50-
echo "Building docker image ${imagename}"
51-
docker build . -t "${imagename}"
50+
echo "Creating new builder instance for multi-platform (linux/amd64, linux/arm64/v8) builds to use for building Graphhopper"
51+
docker buildx create --use --name graphhopperbuilder
5252

53-
if [ "${push}" == "false" ]; then
54-
echo "Use \"docker push ${imagename}\" to publish the image on Docker Hub"
53+
54+
if [ "${push}" == "true" ]; then
55+
echo "Building docker image ${imagename} for linux/amd64 and linux/arm64/v8 and pushing to Docker Hub\n"
56+
docker buildx build --platform linux/amd64,linux/arm64/v8 -t "${imagename}" --push .
5557
else
56-
docker push "${imagename}"
58+
echo "Building docker image ${imagename} for linux/amd64 and linux/arm64/v8\n"
59+
docker buildx build --platform linux/amd64,linux/arm64/v8 -t "${imagename}" .
60+
echo "Use \"docker push ${imagename}\" to publish the image on Docker Hub"
5761
fi
62+
63+
# Remove the builder instance after use
64+
docker buildx rm graphhopperbuilder
65+
rm -rf ./graphhopper

0 commit comments

Comments
 (0)