From eebe071a4329f4d824ca4724865b7644cb46ab98 Mon Sep 17 00:00:00 2001 From: Marius Ihring <89946878+mariusihring@users.noreply.github.com> Date: Fri, 3 May 2024 20:16:32 +0200 Subject: [PATCH] Update build.sh Updating build, so it gets build for arm64 aarch64 and the normal x86, using buildx --- docker/build.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/docker/build.sh b/docker/build.sh index 22104934..5b65a6f5 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -10,9 +10,16 @@ else TAG="$VERSION" fi -docker build --platform linux/amd64 --pull --rm -f 'Dockerfile' -t "dokploy/dokploy:${TAG}" . +# Ensure Docker's buildx plugin is being used and set as the default builder +BUILDER=$(docker buildx create --use) + +# Build and push the images for different architectures +docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 --pull --rm -t "dokploy/dokploy:${TAG}" -f 'Dockerfile' --push . if [ "$BUILD_TYPE" != "canary" ]; then - # Tag the production build as latest - docker tag "dokploy/dokploy:${TAG}" "dokploy/dokploy:latest" + # Tag the production build as latest for all architectures and push + docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 --pull --rm -t "dokploy/dokploy:latest" -f 'Dockerfile' --push . fi + +# Clean up the buildx builder instance +docker buildx rm $BUILDER