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

Commit 6fee2f4

Browse files
authored
Cache Rust build cache when building docker images (#14130)
1 parent c101fc6 commit 6fee2f4

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

changelog.d/14129.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix pinning Rust dependencies in docker images.

changelog.d/14130.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Cache Rust build cache when building docker images.

docker/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ ARG TEST_ONLY_IGNORE_POETRY_LOCKFILE
135135
# Install the synapse package itself.
136136
# If we have populated requirements.txt, we don't install any dependencies
137137
# as we should already have those from the previous `pip install` step.
138-
RUN if [ -z "$TEST_ONLY_IGNORE_POETRY_LOCKFILE" ]; then \
138+
RUN --mount=type=cache,target=/synapse/target,sharing=locked \
139+
--mount=type=cache,target=${CARGO_HOME}/registry,sharing=locked \
140+
if [ -z "$TEST_ONLY_IGNORE_POETRY_LOCKFILE" ]; then \
139141
pip install --prefix="/install" --no-deps --no-warn-script-location /synapse[all]; \
140142
else \
141143
pip install --prefix="/install" --no-warn-script-location /synapse[all]; \

0 commit comments

Comments
 (0)