Skip to content

Commit

Permalink
Work around Synapse Docker build failures by using a --cache-dir (#…
Browse files Browse the repository at this point in the history
…1271)

When the `--no-cache-dir` option is given to pip, setuptools>=48.0.0
installs msgpack to `/usr/lib/python3.7/site-packages/` instead of
`/usr/local/lib/python3.7/dist-packages/`, where Python can't find it.
  • Loading branch information
squahtx authored Jul 19, 2022
1 parent 7142523 commit a975f2a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion docker/synapse.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ RUN apt-get -qq update && apt-get -qq install -y \
apt-utils ${PYTHON_VERSION} ${PYTHON_VERSION}-dev ${PYTHON_VERSION}-venv \
python3-pip eatmydata redis-server

RUN ${PYTHON_VERSION} -m pip install -q --no-cache-dir poetry==1.1.12
RUN ${PYTHON_VERSION} -m pip install --cache-dir /pip-cache poetry==1.1.12 && \
rm -rf /pip-cache
# Instead of using `--no-cache-dir`, we specify a `--cache-dir` and delete it
# afterwards. This works around a bug where `msgpack` gets installed to
# `site-packages`, where Python can't find it, instead of `dist-packages`, when
# using `setuptools>=48.0.0` and the `--no-cache-dir` option.
# https://github.com/matrix-org/sytest/issues/1269

# As part of the Docker build, we attempt to pre-install Synapse's dependencies
# in the hope that it speeds up the real install of Synapse. To make this work,
Expand Down

0 comments on commit a975f2a

Please sign in to comment.