Skip to content

Commit cb162ba

Browse files
committed
feat(build): add multi-arch docker images
Signed-off-by: Brenno Oliveira <brenno.oliveira@deliveryhero.com>
1 parent 39a01d1 commit cb162ba

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

.circleci/config.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,25 @@ 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 build --platform $BUILDX_PLATFORMS -t codacy/codacy-analysis-cli:dev-snapshot --load .
211211
docker save --output docker-image.tar $CIRCLE_PROJECT_REPONAME:dev-snapshot
212+
steps_before_sbt:
213+
- run:
214+
name: Install and set up Docker Buildx
215+
command: |
216+
export DOCKER_BUILDX=1
217+
export BUILDX_VERSION=v0.22.0
218+
export BUILDX_PLATFORMS="linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7"
219+
220+
mkdir -p ~/.docker/cli-plugins
221+
222+
curl --output ~/.docker/cli-plugins/docker-buildx \
223+
--silent --show-error --location --fail --retry 3 \
224+
"https://github.com/docker/buildx/releases/download/${BUILDX_VERSION}/buildx-${BUILDX_VERSION}.linux-amd64"
225+
226+
chmod +x ~/.docker/cli-plugins/docker-buildx
227+
docker buildx install
228+
docker run --rm --privileged tonistiigi/binfmt:latest --install "$BUILDX_PLATFORMS"
212229
cache_prefix: *cache_prefix
213230
persist_to_workspace: true
214231
requires:

0 commit comments

Comments
 (0)