Skip to content

Commit

Permalink
Use an external directory for container python cache
Browse files Browse the repository at this point in the history
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
  • Loading branch information
tpoliaw committed Feb 11, 2025
1 parent ffa0913 commit b431b92
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit b431b92

Please sign in to comment.