Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit b76f53b

Browse files
authored
Multi arch docker support: add arm/v7 and arm64 to our docker images (#7921)
Signed-off-by: Christopher May-Townsend ([email protected])
1 parent bc203c9 commit b76f53b

File tree

2 files changed

+53
-8
lines changed

2 files changed

+53
-8
lines changed

.circleci/config.yml

+52-8
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,36 @@
1-
version: 2
1+
version: 2.1
22
jobs:
33
dockerhubuploadrelease:
4-
machine: true
4+
docker:
5+
- image: docker:git
56
steps:
67
- checkout
7-
- run: docker build -f docker/Dockerfile --label gitsha1=${CIRCLE_SHA1} -t matrixdotorg/synapse:${CIRCLE_TAG} .
8+
- setup_remote_docker
9+
- docker_prepare
810
- run: docker login --username $DOCKER_HUB_USERNAME --password $DOCKER_HUB_PASSWORD
9-
- run: docker push matrixdotorg/synapse:${CIRCLE_TAG}
11+
- docker_build:
12+
tag: -t matrixdotorg/synapse:${CIRCLE_TAG}
13+
platforms: linux/amd64
14+
- docker_build:
15+
tag: -t matrixdotorg/synapse:${CIRCLE_TAG}
16+
platforms: linux/amd64,linux/arm/v7,linux/arm64
17+
1018
dockerhubuploadlatest:
11-
machine: true
19+
docker:
20+
- image: docker:git
1221
steps:
1322
- checkout
14-
- run: docker build -f docker/Dockerfile --label gitsha1=${CIRCLE_SHA1} -t matrixdotorg/synapse:latest .
23+
- setup_remote_docker
24+
- docker_prepare
1525
- run: docker login --username $DOCKER_HUB_USERNAME --password $DOCKER_HUB_PASSWORD
16-
- run: docker push matrixdotorg/synapse:latest
26+
- docker_build:
27+
tag: -t matrixdotorg/synapse:latest
28+
platforms: linux/amd64
29+
- docker_build:
30+
tag: -t matrixdotorg/synapse:latest
31+
platforms: linux/amd64,linux/arm/v7,linux/arm64
1732

1833
workflows:
19-
version: 2
2034
build:
2135
jobs:
2236
- dockerhubuploadrelease:
@@ -29,3 +43,33 @@ workflows:
2943
filters:
3044
branches:
3145
only: master
46+
47+
commands:
48+
docker_prepare:
49+
description: Downloads the buildx cli plugin and enables multiarch images
50+
parameters:
51+
buildx_version:
52+
type: string
53+
default: "v0.4.1"
54+
steps:
55+
- run: apk add --no-cache curl
56+
- run: mkdir -vp ~/.docker/cli-plugins/ ~/dockercache
57+
- run: curl --silent -L "https://github.com/docker/buildx/releases/download/<< parameters.buildx_version >>/buildx-<< parameters.buildx_version >>.linux-amd64" > ~/.docker/cli-plugins/docker-buildx
58+
- run: chmod a+x ~/.docker/cli-plugins/docker-buildx
59+
# install qemu links in /proc/sys/fs/binfmt_misc on the docker instance running the circleci job
60+
- run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
61+
# create a context named `builder` for the builds
62+
- run: docker context create builder
63+
# create a buildx builder using the new context, and set it as the default
64+
- run: docker buildx create builder --use
65+
66+
docker_build:
67+
description: Builds and pushed images to dockerhub using buildx
68+
parameters:
69+
platforms:
70+
type: string
71+
default: linux/amd64
72+
tag:
73+
type: string
74+
steps:
75+
- run: docker buildx build -f docker/Dockerfile --push --platform << parameters.platforms >> --label gitsha1=${CIRCLE_SHA1} << parameters.tag >> --progress=plain .

changelog.d/7921.docker

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added multi-arch support (arm64,arm/v7) for the docker images. Contributed by @maquis196.

0 commit comments

Comments
 (0)