summary refs log tree commit diff
path: root/docker
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2022-10-17 18:21:14 +0100
committerGitHub <noreply@github.com>2022-10-17 17:21:14 +0000
commit6fee2f49f3cbcc4337493907151c9535228434ab (patch)
tree8c1ed95d76d7b46c93493f32f184c1f10aa34afc /docker
parentBump click from 8.1.1 to 8.1.3 (#14201) (diff)
downloadsynapse-6fee2f49f3cbcc4337493907151c9535228434ab.tar.xz
Cache Rust build cache when building docker images (#14130)
Diffstat (limited to 'docker')
-rw-r--r--docker/Dockerfile4
1 files changed, 3 insertions, 1 deletions
diff --git a/docker/Dockerfile b/docker/Dockerfile
index f13d45bcd9..7f8756e8a4 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -135,7 +135,9 @@ ARG TEST_ONLY_IGNORE_POETRY_LOCKFILE
 # Install the synapse package itself.
 # If we have populated requirements.txt, we don't install any dependencies
 # as we should already have those from the previous `pip install` step.
-RUN if [ -z "$TEST_ONLY_IGNORE_POETRY_LOCKFILE" ]; then \
+RUN --mount=type=cache,target=/synapse/target,sharing=locked \
+  --mount=type=cache,target=${CARGO_HOME}/registry,sharing=locked \
+  if [ -z "$TEST_ONLY_IGNORE_POETRY_LOCKFILE" ]; then \
     pip install --prefix="/install" --no-deps --no-warn-script-location /synapse[all]; \
   else \
     pip install --prefix="/install" --no-warn-script-location /synapse[all]; \