Skip to content

Commit 333acfe

Browse files
committed
feat(build): add multi-arch docker images
1 parent 39a01d1 commit 333acfe

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

.circleci/config.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,23 @@ workflows:
207207
cmd: |
208208
sbt "set codacyAnalysisCli / version := \"dev-snapshot\";
209209
codacyAnalysisCli/stage"
210-
docker build -t $CIRCLE_PROJECT_REPONAME:dev-snapshot .
210+
docker buildx create --name builder --driver docker-container --use
211+
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7 -t $CIRCLE_PROJECT_REPONAME:dev-snapshot --output="type=image" .
211212
docker save --output docker-image.tar $CIRCLE_PROJECT_REPONAME:dev-snapshot
213+
steps_before_sbt:
214+
- run:
215+
name: Install and set up Docker Buildx
216+
command: |
217+
export DOCKER_BUILDX=1
218+
export BUILDX_VERSION=v0.22.0
219+
export BUILDX_PLATFORMS="linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7"
220+
mkdir -p ~/.docker/cli-plugins
221+
curl --output ~/.docker/cli-plugins/docker-buildx \
222+
--silent --show-error --location --fail --retry 3 \
223+
"https://github.com/docker/buildx/releases/download/${BUILDX_VERSION}/buildx-${BUILDX_VERSION}.linux-amd64"
224+
chmod +x ~/.docker/cli-plugins/docker-buildx
225+
docker buildx install
226+
docker run --rm --privileged tonistiigi/binfmt:latest --install "$BUILDX_PLATFORMS"
212227
cache_prefix: *cache_prefix
213228
persist_to_workspace: true
214229
requires:

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,7 @@ project/project/
9292
.vscode/
9393

9494
.codacy
95+
96+
97+
#Ignore cursor AI rules
98+
.cursor/rules/codacy.mdc

0 commit comments

Comments
 (0)