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

Commit 29ee4b6

Browse files
erikjohnstonDavid Robertson
and
David Robertson
authoredOct 13, 2022
Fix docker build OOMing in CI for arm64 builds (#14173)
Co-authored-by: David Robertson <davidr@element.io>
1 parent 16c5d95 commit 29ee4b6

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed
 

‎.github/workflows/docker.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727

2828
- name: Inspect builder
2929
run: docker buildx inspect
30-
30+
3131
- name: Log in to DockerHub
3232
uses: docker/login-action@v2
3333
with:
@@ -55,3 +55,6 @@ jobs:
5555
tags: "${{ steps.set-tag.outputs.tags }}"
5656
file: "docker/Dockerfile"
5757
platforms: linux/amd64,linux/arm64
58+
build-args:
59+
# arm64 builds OOM otherwise. c.f. https://github.com/rust-lang/cargo/issues/10583
60+
CARGO_NET_GIT_FETCH_WITH_CLI: true

‎changelog.d/14173.docker

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix docker build OOMing in CI for arm64 builds.

‎docker/Dockerfile

+6
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,12 @@ RUN mkdir /rust /cargo
108108

109109
RUN curl -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path --default-toolchain stable
110110

111+
112+
# arm64 builds consume a lot of memory if `CARGO_NET_GIT_FETCH_WITH_CLI` is not
113+
# set to true, so we expose it as a build-arg.
114+
ARG CARGO_NET_GIT_FETCH_WITH_CLI=false
115+
ENV CARGO_NET_GIT_FETCH_WITH_CLI=$CARGO_NET_GIT_FETCH_WITH_CLI
116+
111117
# To speed up rebuilds, install all of the dependencies before we copy over
112118
# the whole synapse project, so that this layer in the Docker cache can be
113119
# used while you develop on the source

0 commit comments

Comments
 (0)