From 883c4a23b194b214f89afe82308d3850c2ea62e1 Mon Sep 17 00:00:00 2001 From: Brenno Oliveira Date: Sat, 12 Apr 2025 17:46:03 +0200 Subject: [PATCH] feat(build): add multi-arch docker images Signed-off-by: Brenno Oliveira --- .circleci/config.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8bc01c9a..c278c791 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -207,8 +207,25 @@ workflows: cmd: | sbt "set codacyAnalysisCli / version := \"dev-snapshot\"; codacyAnalysisCli/stage" - docker build -t $CIRCLE_PROJECT_REPONAME:dev-snapshot . + docker buildx build --platform $BUILDX_PLATFORMS -t $CIRCLE_PROJECT_REPONAME:dev-snapshot --load . 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: