From f3db6a19d97f42516fde397ae32cf95b36c7317e Mon Sep 17 00:00:00 2001 From: Matthieu Napoli Date: Tue, 14 Mar 2023 00:13:57 +0100 Subject: [PATCH 1/3] Remove useless arg --- .github/workflows/tests.yml | 1 - Makefile | 2 -- docker-bake.hcl | 15 --------------- php-80/Dockerfile | 7 ++----- php-81/Dockerfile | 7 ++----- php-82/Dockerfile | 7 ++----- 6 files changed, 6 insertions(+), 33 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8f9d3078..36429137 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -67,7 +67,6 @@ jobs: CPU: ${{ matrix.cpu }} CPU_PREFIX: ${{ (matrix.cpu == 'arm') && 'arm-' || '' }} PHP_VERSION: ${{ matrix.php_version }} - IMAGE_VERSION_SUFFIX: ${{ (matrix.cpu == 'arm') && 'arm64' || 'x86_64' }} DOCKER_PLATFORM: ${{ (matrix.cpu == 'arm') && 'linux/arm64' || 'linux/amd64' }} - name: Test that layers can be exported diff --git a/Makefile b/Makefile index d4a5cb37..5caf51c6 100644 --- a/Makefile +++ b/Makefile @@ -9,13 +9,11 @@ ifeq ($(CPU), arm) # if $CPU=="arm" $(info "⚠️ Building for ARM") # Print a message export CPU = arm export CPU_PREFIX = arm- - export IMAGE_VERSION_SUFFIX = arm64 export DOCKER_PLATFORM = linux/arm64 else $(info "⚠️ Building for x86") # Print a message export CPU = x86 export CPU_PREFIX = - export IMAGE_VERSION_SUFFIX = x86_64 export DOCKER_PLATFORM = linux/amd64 endif diff --git a/docker-bake.hcl b/docker-bake.hcl index b08040c4..846e14a6 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -8,20 +8,11 @@ variable "CPU" { variable "PHP_VERSION" { default = "80" } -variable "IMAGE_VERSION_SUFFIX" { - default = "x86_64" -} -variable "DOCKER_PLATFORM" { - default = "linux/amd64" -} target "build-php" { dockerfile = "php-${PHP_VERSION}/Dockerfile" target = "build-environment" tags = ["bref/build-php-${PHP_VERSION}"] - args = { - "IMAGE_VERSION_SUFFIX" = "${IMAGE_VERSION_SUFFIX}" - } platforms = ["${DOCKER_PLATFORM}"] } @@ -29,9 +20,6 @@ target "php" { dockerfile = "php-${PHP_VERSION}/Dockerfile" target = "function" tags = ["bref/php-${PHP_VERSION}"] - args = { - "IMAGE_VERSION_SUFFIX" = "${IMAGE_VERSION_SUFFIX}" - } contexts = { "bref/build-php-${PHP_VERSION}" = "target:build-php" } @@ -42,9 +30,6 @@ target "php-fpm" { dockerfile = "php-${PHP_VERSION}/Dockerfile" target = "fpm" tags = ["bref/php-${PHP_VERSION}-fpm"] - args = { - "IMAGE_VERSION_SUFFIX" = "${IMAGE_VERSION_SUFFIX}" - } contexts = { "bref/build-php-${PHP_VERSION}" = "target:build-php" "bref/php-${PHP_VERSION}" = "target:php" diff --git a/php-80/Dockerfile b/php-80/Dockerfile index 21e8c4a5..20beaa22 100644 --- a/php-80/Dockerfile +++ b/php-80/Dockerfile @@ -1,8 +1,5 @@ # syntax = docker/dockerfile:1.4 -# Can be "x86_64" or "arm64" -ARG IMAGE_VERSION_SUFFIX - # https://www.php.net/downloads ARG VERSION_PHP=8.0.27 @@ -11,7 +8,7 @@ ARG VERSION_PHP=8.0.27 # https://docs.aws.amazon.com/lambda/latest/dg/current-supported-versions.html # AWS provides a Docker image that we use here: # https://github.com/amazonlinux/container-images/tree/amzn2 -FROM public.ecr.aws/lambda/provided:al2-${IMAGE_VERSION_SUFFIX} as build-environment +FROM public.ecr.aws/lambda/provided:al2 as build-environment RUN set -xe \ @@ -444,7 +441,7 @@ RUN cp ${CA_BUNDLE} /bref-layer/ssl/cert.pem # --------------------------------------------------------------- # Start from a clean image to copy only the files we need -FROM public.ecr.aws/lambda/provided:al2-${IMAGE_VERSION_SUFFIX} as isolation +FROM public.ecr.aws/lambda/provided:al2 as isolation # We selected the files in /bref-layer, now we copy them to /opt (the real directory for the Lambda layer) COPY --link --from=build-environment /bref-layer /opt diff --git a/php-81/Dockerfile b/php-81/Dockerfile index 0c2cbe8b..436723e1 100644 --- a/php-81/Dockerfile +++ b/php-81/Dockerfile @@ -1,8 +1,5 @@ # syntax = docker/dockerfile:1.4 -# Can be "x86_64" or "arm64" -ARG IMAGE_VERSION_SUFFIX - # https://www.php.net/downloads ARG VERSION_PHP=8.1.15 @@ -11,7 +8,7 @@ ARG VERSION_PHP=8.1.15 # https://docs.aws.amazon.com/lambda/latest/dg/current-supported-versions.html # AWS provides a Docker image that we use here: # https://github.com/amazonlinux/container-images/tree/amzn2 -FROM public.ecr.aws/lambda/provided:al2-${IMAGE_VERSION_SUFFIX} as build-environment +FROM public.ecr.aws/lambda/provided:al2 as build-environment RUN set -xe \ @@ -444,7 +441,7 @@ RUN cp ${CA_BUNDLE} /bref-layer/ssl/cert.pem # --------------------------------------------------------------- # Start from a clean image to copy only the files we need -FROM public.ecr.aws/lambda/provided:al2-${IMAGE_VERSION_SUFFIX} as isolation +FROM public.ecr.aws/lambda/provided:al2 as isolation # We selected the files in /bref-layer, now we copy them to /opt (the real directory for the Lambda layer) COPY --link --from=build-environment /bref-layer /opt diff --git a/php-82/Dockerfile b/php-82/Dockerfile index 9b49774a..c46f8a59 100644 --- a/php-82/Dockerfile +++ b/php-82/Dockerfile @@ -1,8 +1,5 @@ # syntax = docker/dockerfile:1.4 -# Can be "x86_64" or "arm64" -ARG IMAGE_VERSION_SUFFIX - # https://www.php.net/downloads ARG VERSION_PHP=8.2.2 @@ -11,7 +8,7 @@ ARG VERSION_PHP=8.2.2 # https://docs.aws.amazon.com/lambda/latest/dg/current-supported-versions.html # AWS provides a Docker image that we use here: # https://github.com/amazonlinux/container-images/tree/amzn2 -FROM public.ecr.aws/lambda/provided:al2-${IMAGE_VERSION_SUFFIX} as build-environment +FROM public.ecr.aws/lambda/provided:al2 as build-environment RUN set -xe \ @@ -444,7 +441,7 @@ RUN cp ${CA_BUNDLE} /bref-layer/ssl/cert.pem # --------------------------------------------------------------- # Start from a clean image to copy only the files we need -FROM public.ecr.aws/lambda/provided:al2-${IMAGE_VERSION_SUFFIX} as isolation +FROM public.ecr.aws/lambda/provided:al2 as isolation # We selected the files in /bref-layer, now we copy them to /opt (the real directory for the Lambda layer) COPY --link --from=build-environment /bref-layer /opt From 9da59ffd4d5cf294b25a91626496d3a79ebdafb8 Mon Sep 17 00:00:00 2001 From: Matthieu Napoli Date: Tue, 14 Mar 2023 00:40:47 +0100 Subject: [PATCH 2/3] Continue unifying build scripts to build multi-platform --- .github/workflows/release.yml | 19 +--------------- .github/workflows/tests.yml | 39 +++----------------------------- Makefile | 36 +++++++++++++++++------------- docker-bake.hcl | 20 +++++++---------- layers/fpm-dev/Dockerfile | 4 +--- tests/Makefile | 42 +++++++++++++++++------------------ 6 files changed, 53 insertions(+), 107 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2aa01cab..1eaabf9b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,13 +16,8 @@ permissions: jobs: release: - name: Publish ${{ matrix.cpu }} layers + name: Publish layers runs-on: ubuntu-latest - strategy: - matrix: - cpu: - - x86 - - arm steps: - uses: actions/checkout@v3 @@ -47,25 +42,13 @@ jobs: - run: make docker-images env: - CPU: ${{ matrix.cpu }} USE_DEPOT: 1 DEPOT_TOKEN: ${{ secrets.DEPOT_TOKEN }} - run: make layers - env: - CPU: ${{ matrix.cpu }} - - run: make test - env: - CPU: ${{ matrix.cpu }} - - run: make upload-layers - env: - CPU: ${{ matrix.cpu }} - - run: make upload-to-docker-hub - env: - CPU: ${{ matrix.cpu }} update-layer-versions: name: Update layer versions in brefphp/bref diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 36429137..cf6b491f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,38 +13,14 @@ permissions: contents: read jobs: - matrix-prep: - name: Prepare matrix - runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.set-matrix.outputs.result }} - steps: - - uses: actions/github-script@v6 - id: set-matrix - with: - script: | - const matrix = { - cpu: ['x86', 'arm'], - php_version: ['80', '81', '82'], - } - - // If this is a third-party pull request, skip ARM builds - if (context.eventName === 'pull_request') { - const pr = context.payload.pull_request - if (pr.head.repo.full_name !== pr.base.repo.full_name) { - matrix.cpu = ['x86'] - } - } - - return matrix tests: - name: Build and tests PHP ${{ matrix.php_version }}, ${{ matrix.cpu }} + name: Build and tests PHP ${{ matrix.php_version }} runs-on: ubuntu-latest - needs: matrix-prep strategy: fail-fast: false - matrix: ${{ fromJson(needs.matrix-prep.outputs.matrix) }} + matrix: + php_version: ['80', '81', '82'] steps: - uses: actions/checkout@v3 @@ -64,25 +40,16 @@ jobs: # If this is an third-party pull request, fall back to the local buildx builder buildx-fallback: ${{ github.event.pull_request.head.repo.full_name != github.repository }} env: - CPU: ${{ matrix.cpu }} - CPU_PREFIX: ${{ (matrix.cpu == 'arm') && 'arm-' || '' }} PHP_VERSION: ${{ matrix.php_version }} - DOCKER_PLATFORM: ${{ (matrix.cpu == 'arm') && 'linux/arm64' || 'linux/amd64' }} - name: Test that layers can be exported run: | make layer-php-${{ matrix.php_version }} make layer-php-${{ matrix.php_version }}-fpm - env: - CPU: ${{ matrix.cpu }} - name: Test that the "console" layer can be exported run: make layer-console if: ${{ matrix.php_version == 80 }} - env: - CPU: ${{ matrix.cpu }} - name: Run tests run: make test-${{ matrix.php_version }} - env: - CPU: ${{ matrix.cpu }} diff --git a/Makefile b/Makefile index 5caf51c6..b3856b6c 100644 --- a/Makefile +++ b/Makefile @@ -5,16 +5,24 @@ export # export all variables defined in .env # Define all the environment variables depending on the CPU # Set CPU= (empty) to build for x86 # Set CPU=arm to build for ARM -ifeq ($(CPU), arm) # if $CPU=="arm" +ifeq ($(CPU), x86) # if $CPU=="x86" + $(info "⚠️ Building for x86") # Print a message + export CPU = x86 + export CPU_PREFIX = + export DOCKER_PLATFORM = linux/amd64 + export BAKE_OPTIONS = "--set *.platform=${DOCKER_PLATFORM}" +else ifeq ($(CPU), arm) # if $CPU=="arm" $(info "⚠️ Building for ARM") # Print a message export CPU = arm export CPU_PREFIX = arm- export DOCKER_PLATFORM = linux/arm64 + export BAKE_OPTIONS = "--set *.platform=${DOCKER_PLATFORM}" else - $(info "⚠️ Building for x86") # Print a message - export CPU = x86 + $(info "⚠️ Building for x86 and ARM") # Print a message + export CPU = export CPU_PREFIX = - export DOCKER_PLATFORM = linux/amd64 + export DOCKER_PLATFORM = + export BAKE_OPTIONS = endif # By default, Docker images are built using `docker buildx bake` @@ -35,21 +43,18 @@ default: docker-images layers # Build Docker images *locally* docker-images: docker-images-php-80 docker-images-php-81 docker-images-php-82 docker-images-php-%: - PHP_VERSION=$* ${BAKE_COMMAND} --load + PHP_VERSION=$* ${BAKE_COMMAND} --load ${BAKE_OPTIONS} # Build Lambda layers (zip files) *locally* -layers: layer-php-80 layer-php-81 layer-php-82 layer-php-80-fpm layer-php-81-fpm layer-php-82-fpm - # Build the console layer only once (x86 and single PHP version) - @if [ ${CPU} = "x86" ]; then \ - $(MAKE) layer-console; \ - fi +layers: layer-php-80 layer-php-81 layer-php-82 layer-php-80-fpm layer-php-81-fpm layer-php-82-fpm layer-console layer-console: - ./utils/docker-zip-dir.sh bref/console-zip console + DOCKER_PLATFORM=linux/amd64 ./utils/docker-zip-dir.sh bref/console-zip console # This rule matches with a wildcard, for example `layer-php-80`. # The `$*` variable will contained the matched part, in this case `php-80`. layer-%: - ./utils/docker-zip-dir.sh bref/$* ${CPU_PREFIX}$* + DOCKER_PLATFORM=linux/amd64 ./utils/docker-zip-dir.sh bref/$* $* + DOCKER_PLATFORM=linux/arm64 ./utils/docker-zip-dir.sh bref/$* arm-$* # Upload the layers to AWS Lambda @@ -84,20 +89,19 @@ upload-to-docker-hub-php-%: test: test-80 test-81 test-82 test-%: - cd tests && $(MAKE) test-$* + cd tests && DOCKER_PLATFORM=linux/amd64 $(MAKE) test-$* + cd tests && DOCKER_PLATFORM=linux/arm64 $(MAKE) test-$* clean: clean-80 clean-81 clean-82 # Clear the build cache, else all images will be rebuilt using cached layers docker builder prune # Remove zip files - rm -f output/${CPU_PREFIX}*.zip + rm -f output/*.zip clean-%: # Clean Docker images to force rebuilding them docker image rm --force bref/build-php-$* \ bref/php-$* \ - bref/php-$*-zip \ bref/php-$*-fpm \ - bref/php-$*-fpm-zip \ bref/php-$*-fpm-dev \ bref/php-$*-console diff --git a/docker-bake.hcl b/docker-bake.hcl index 846e14a6..20ed327a 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -2,9 +2,6 @@ group "default" { targets = ["build-php", "php", "php-fpm", "console-zip", "console", "php-fpm-dev"] } -variable "CPU" { - default = "x86" -} variable "PHP_VERSION" { default = "80" } @@ -13,28 +10,28 @@ target "build-php" { dockerfile = "php-${PHP_VERSION}/Dockerfile" target = "build-environment" tags = ["bref/build-php-${PHP_VERSION}"] - platforms = ["${DOCKER_PLATFORM}"] + platforms = ["linux/arm64", "linux/amd64"] } target "php" { dockerfile = "php-${PHP_VERSION}/Dockerfile" target = "function" tags = ["bref/php-${PHP_VERSION}"] - contexts = { + contexts = { "bref/build-php-${PHP_VERSION}" = "target:build-php" } - platforms = ["${DOCKER_PLATFORM}"] + platforms = ["linux/arm64", "linux/amd64"] } target "php-fpm" { dockerfile = "php-${PHP_VERSION}/Dockerfile" target = "fpm" tags = ["bref/php-${PHP_VERSION}-fpm"] - contexts = { + contexts = { "bref/build-php-${PHP_VERSION}" = "target:build-php" "bref/php-${PHP_VERSION}" = "target:php" } - platforms = ["${DOCKER_PLATFORM}"] + platforms = ["linux/arm64", "linux/amd64"] } target "console-zip" { @@ -44,7 +41,7 @@ target "console-zip" { args = { PHP_VERSION = "${PHP_VERSION}" } - platforms = ["${DOCKER_PLATFORM}"] + platforms = ["linux/arm64", "linux/amd64"] } target "console" { @@ -58,7 +55,7 @@ target "console" { "bref/build-php-${PHP_VERSION}" = "target:build-php" "bref/php-${PHP_VERSION}" = "target:php" } - platforms = ["${DOCKER_PLATFORM}"] + platforms = ["linux/arm64", "linux/amd64"] } target "php-fpm-dev" { @@ -66,7 +63,6 @@ target "php-fpm-dev" { tags = ["bref/php-${PHP_VERSION}-fpm-dev"] args = { PHP_VERSION = "${PHP_VERSION}" - "CPU" = "${CPU}" } contexts = { "bref/build-php-${PHP_VERSION}" = "target:build-php" @@ -74,5 +70,5 @@ target "php-fpm-dev" { "bref/php-${PHP_VERSION}-fpm" = "target:php-fpm" "bref/local-api-gateway" = "docker-image://bref/local-api-gateway:latest" } - platforms = ["${DOCKER_PLATFORM}"] + platforms = ["linux/arm64", "linux/amd64"] } diff --git a/layers/fpm-dev/Dockerfile b/layers/fpm-dev/Dockerfile index 353bb954..e40863c1 100644 --- a/layers/fpm-dev/Dockerfile +++ b/layers/fpm-dev/Dockerfile @@ -1,5 +1,4 @@ # syntax = docker/dockerfile:1.4 -ARG CPU ARG PHP_VERSION @@ -16,8 +15,7 @@ RUN cp $(php -r "echo ini_get('extension_dir');")/xdebug.so /opt/bref/extensions # Install Blackfire # https://blackfire.io/docs/up-and-running/installation?action=install&mode=full&version=latest&mode=full&location=server&os=manual&language=php#install-the-php-probe ARG BLACKFIRE_VERSION=1.86.1 -RUN if [[ $CPU == "x86" ]]; then curl -A "Docker" -o /opt/bref/extensions/blackfire.so -L -s "https://packages.blackfire.io/binaries/blackfire-php/$BLACKFIRE_VERSION/blackfire-php-linux_amd64-php-"$PHP_VERSION".so"; fi -RUN if [[ $CPU == "arm" ]]; then curl -A "Docker" -o /opt/bref/extensions/blackfire.so -L -s "https://packages.blackfire.io/binaries/blackfire-php/$BLACKFIRE_VERSION/blackfire-php-linux_arm64-php-"$PHP_VERSION".so"; fi +RUN curl -A "Docker" -o /opt/bref/extensions/blackfire.so -L -s "https://packages.blackfire.io/binaries/blackfire-php/$BLACKFIRE_VERSION/blackfire-php-linux_$TARGETARCH-php-"$PHP_VERSION".so" FROM bref/php-${PHP_VERSION}-fpm diff --git a/tests/Makefile b/tests/Makefile index fd486731..0ad44214 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,5 +1,3 @@ -export CPU_PREFIX ?= - test: test-80 test-81 test-82 # This rule matches with a wildcard, for example `test-80`. @@ -16,37 +14,37 @@ test-%: vendor test_3_manual_enabling_extensions.php # Test function handler - docker stop test-${CPU_PREFIX}php-$* 2> /dev/null || true # silence errors - docker run --platform=${DOCKER_PLATFORM} --rm --detach -v=$(PWD):/var/task:ro --name test-${CPU_PREFIX}php-$* \ + docker stop test-php-$* 2> /dev/null || true # silence errors + docker run --platform=${DOCKER_PLATFORM} --rm --detach -v=$(PWD):/var/task:ro --name test-php-$* \ bref/php-$* test_4_function_handler.php - docker exec test-${CPU_PREFIX}php-$* php test_4_function_invocation.php \ - || (docker logs test-${CPU_PREFIX}php-$* && exit 1) - docker stop test-${CPU_PREFIX}php-$* + docker exec test-php-$* php test_4_function_invocation.php \ + || (docker logs test-php-$* && exit 1) + docker stop test-php-$* # Test FPM handler - docker stop test-${CPU_PREFIX}php-$*-fpm 2> /dev/null || true # silence errors - docker run --platform=${DOCKER_PLATFORM} --rm --detach -v=$(PWD):/var/task:ro --name test-${CPU_PREFIX}php-$*-fpm \ + docker stop test-php-$*-fpm 2> /dev/null || true # silence errors + docker run --platform=${DOCKER_PLATFORM} --rm --detach -v=$(PWD):/var/task:ro --name test-php-$*-fpm \ bref/php-$*-fpm test_5_fpm_handler.php - docker exec test-${CPU_PREFIX}php-$*-fpm php test_5_fpm_invocation.php \ - || (docker logs test-${CPU_PREFIX}php-$*-fpm && exit 1) # print logs in case of failure - docker stop test-${CPU_PREFIX}php-$*-fpm + docker exec test-php-$*-fpm php test_5_fpm_invocation.php \ + || (docker logs test-php-$*-fpm && exit 1) # print logs in case of failure + docker stop test-php-$*-fpm # Test console handler - docker stop test-${CPU_PREFIX}php-$*-console 2> /dev/null || true # silence errors - docker run --platform=${DOCKER_PLATFORM} --rm --detach -v=$(PWD):/var/task:ro --name test-${CPU_PREFIX}php-$*-console \ + docker stop test-php-$*-console 2> /dev/null || true # silence errors + docker run --platform=${DOCKER_PLATFORM} --rm --detach -v=$(PWD):/var/task:ro --name test-php-$*-console \ bref/php-$*-console test_6_console_handler.php - docker exec test-${CPU_PREFIX}php-$*-console php test_6_console_invocation.php \ - || (docker logs test-${CPU_PREFIX}php-$*-console && exit 1) # print logs in case of failure - docker stop test-${CPU_PREFIX}php-$*-console + docker exec test-php-$*-console php test_6_console_invocation.php \ + || (docker logs test-php-$*-console && exit 1) # print logs in case of failure + docker stop test-php-$*-console # Test that we can override PHP_INI_SCAN_DIR - docker stop test-${CPU_PREFIX}php-$*-test7 2> /dev/null || true # silence errors - docker run --platform=${DOCKER_PLATFORM} --rm --detach -v=$(PWD):/var/task:ro --name test-${CPU_PREFIX}php-$*-test7 \ + docker stop test-php-$*-test7 2> /dev/null || true # silence errors + docker run --platform=${DOCKER_PLATFORM} --rm --detach -v=$(PWD):/var/task:ro --name test-php-$*-test7 \ -e PHP_INI_SCAN_DIR="/opt/bref/etc/php/conf.d/:/var/task/" \ bref/php-$* test_4_function_handler.php - docker exec test-${CPU_PREFIX}php-$*-test7 php test_7_custom_ini_scan_dir.php \ - || (docker logs test-${CPU_PREFIX}php-$*-test7 && exit 1) # print logs in case of failure - docker stop test-${CPU_PREFIX}php-$*-test7 + docker exec test-php-$*-test7 php test_7_custom_ini_scan_dir.php \ + || (docker logs test-php-$*-test7 && exit 1) # print logs in case of failure + docker stop test-php-$*-test7 echo "\033[1;32m✓ Tests succeeded\033[0m" From 2968613aa67fbf9c9201d1080226b6a99a606836 Mon Sep 17 00:00:00 2001 From: Matthieu Napoli Date: Mon, 22 May 2023 15:27:58 +0200 Subject: [PATCH 3/3] Fix option --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index f1e5524f..45099b94 100644 --- a/Makefile +++ b/Makefile @@ -10,13 +10,13 @@ ifeq ($(CPU), x86) # if $CPU=="x86" export CPU = x86 export CPU_PREFIX = export DOCKER_PLATFORM = linux/amd64 - export BAKE_OPTIONS = "--set *.platform=${DOCKER_PLATFORM}" + export BAKE_OPTIONS = --set *.platform=${DOCKER_PLATFORM} else ifeq ($(CPU), arm) # if $CPU=="arm" $(info "⚠️ Building for ARM") # Print a message export CPU = arm export CPU_PREFIX = arm- export DOCKER_PLATFORM = linux/arm64 - export BAKE_OPTIONS = "--set *.platform=${DOCKER_PLATFORM}" + export BAKE_OPTIONS = --set *.platform=${DOCKER_PLATFORM} else $(info "⚠️ Building for x86 and ARM") # Print a message export CPU =