From b431b92958eaf9b7ce7d8967a1c7be88727f06d0 Mon Sep 17 00:00:00 2001 From: Peter Holloway Date: Tue, 11 Feb 2025 14:13:49 +0000 Subject: [PATCH] Use an external directory for container python cache With this set, the pyc files are created in a mirror directory instead of the source tree. When running in a shared directory (as is the case for the scratch area used by bluapi), this prevents files being created with permissions that prevent other users removing them. See python docs at https://docs.python.org/3/using/cmdline.html#envvar-PYTHONPYCACHEPREFIX --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 06b988263..0b2690752 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,6 +27,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ && rm -rf /var/lib/apt/lists/* COPY --from=build /venv/ /venv/ ENV PATH=/venv/bin:$PATH +ENV PYTHONPYCACHEPREFIX=/tmp/blueapi_pycache RUN mkdir -p /.cache/pip; chmod -R 777 /venv /.cache/pip