From 333acfef18319a51cc94f35a12d53f5fb3c11b92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9lio=20Rocha?= Date: Mon, 14 Apr 2025 14:31:12 +0100 Subject: [PATCH] feat(build): add multi-arch docker images --- .circleci/config.yml | 17 ++++++++++++++++- .gitignore | 4 ++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8bc01c9a..053217d8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -207,8 +207,23 @@ workflows: cmd: | sbt "set codacyAnalysisCli / version := \"dev-snapshot\"; codacyAnalysisCli/stage" - docker build -t $CIRCLE_PROJECT_REPONAME:dev-snapshot . + docker buildx create --name builder --driver docker-container --use + docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7 -t $CIRCLE_PROJECT_REPONAME:dev-snapshot --output="type=image" . docker save --output docker-image.tar $CIRCLE_PROJECT_REPONAME:dev-snapshot + steps_before_sbt: + - run: + name: Install and set up Docker Buildx + command: | + export DOCKER_BUILDX=1 + export BUILDX_VERSION=v0.22.0 + export BUILDX_PLATFORMS="linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7" + mkdir -p ~/.docker/cli-plugins + curl --output ~/.docker/cli-plugins/docker-buildx \ + --silent --show-error --location --fail --retry 3 \ + "https://github.com/docker/buildx/releases/download/${BUILDX_VERSION}/buildx-${BUILDX_VERSION}.linux-amd64" + chmod +x ~/.docker/cli-plugins/docker-buildx + docker buildx install + docker run --rm --privileged tonistiigi/binfmt:latest --install "$BUILDX_PLATFORMS" cache_prefix: *cache_prefix persist_to_workspace: true requires: diff --git a/.gitignore b/.gitignore index 5ead7916..48b97171 100644 --- a/.gitignore +++ b/.gitignore @@ -92,3 +92,7 @@ project/project/ .vscode/ .codacy + + +#Ignore cursor AI rules +.cursor/rules/codacy.mdc