--- lbbs-combo/build.sh 2026/01/08 03:27:09 1.1 +++ lbbs-combo/build.sh 2026/01/09 11:16:28 1.2 @@ -1,10 +1,29 @@ #!/bin/sh +if [ ! -n "$DOCKER_PLATFORMS" ]; then + DOCKER_PLATFORMS="linux/amd64,linux/arm64" +fi + +if [ ! -n "$RUN_PLATFORM" ]; then + RUN_PLATFORM="linux/amd64" +fi + git submodule update --init --recursive -docker build ./leafok_bbs --file ./leafok_bbs/Dockerfile/dockerfile.apache --tag leafok/lbbs-apache:latest -docker build ./leafok_bbs --file ./leafok_bbs/Dockerfile/dockerfile.php --tag leafok/lbbs-php:latest -docker build ./lbbs --file ./lbbs/Dockerfile/dockerfile.bbsd --tag leafok/lbbs-bbsd:latest -docker build . --file Dockerfile/dockerfile.apache.testing --tag leafok/lbbs-apache:testing -docker build . --file Dockerfile/dockerfile.php.testing --tag leafok/lbbs-php:testing -docker build . --file Dockerfile/dockerfile.bbsd.testing --tag leafok/lbbs-bbsd:testing +docker buildx ls | grep multi-platform-builder + +if [ $? -ne 0 ]; then + docker buildx create --use --name multi-platform-builder --platform=$DOCKER_PLATFORMS +else + docker buildx use multi-platform-builder +fi + +docker buildx inspect multi-platform-builder --bootstrap + +docker buildx build . --platform=$DOCKER_PLATFORMS --file Dockerfile/dockerfile.apache.testing --tag leafok/lbbs-apache:testing +docker buildx build . --platform=$DOCKER_PLATFORMS --file Dockerfile/dockerfile.php.testing --tag leafok/lbbs-php:testing +docker buildx build . --platform=$DOCKER_PLATFORMS --file Dockerfile/dockerfile.bbsd.testing --tag leafok/lbbs-bbsd:testing + +docker buildx build . --platform=$RUN_PLATFORM --file Dockerfile/dockerfile.apache.testing --tag leafok/lbbs-apache:testing --load +docker buildx build . --platform=$RUN_PLATFORM --file Dockerfile/dockerfile.php.testing --tag leafok/lbbs-php:testing --load +docker buildx build . --platform=$RUN_PLATFORM --file Dockerfile/dockerfile.bbsd.testing --tag leafok/lbbs-bbsd:testing --load