Skip to content

Commit

Permalink
Redirect system python to venv python
Browse files Browse the repository at this point in the history
  • Loading branch information
Jongmassey committed May 3, 2024
1 parent cdd84e6 commit 1726c65
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ RUN echo "auth-none=1" >> /etc/rstudio/rserver.conf && echo "USER=rstudio" >> /e
# DL3022: hadolint can't access a network and doesn't behave
# as expected when a reference is made to an external image.
# hadolint ignore=DL3022
COPY --from=ghcr.io/opensafely-core/python:v2 /opt/venv /opt/venv
COPY --chown=rstudio:rstudio --from=ghcr.io/opensafely-core/python:v2 /opt/venv /opt/venv

# Create a fake system Python pointing at venv python
RUN echo 'exec /opt/venv/bin/python3.10 "$@"' > /usr/bin/python

# Create a local user and give it sudo (aka root) permissions
RUN usermod -aG sudo rstudio &&\
Expand Down

0 comments on commit 1726c65

Please sign in to comment.