From 4acc799fd81a56ad4fe3cb3de82233c271928d58 Mon Sep 17 00:00:00 2001 From: Jon Massey Date: Wed, 8 May 2024 11:40:44 +0100 Subject: [PATCH] Add bash shebang to redirected python and make executable --- Dockerfile | 4 +++- justfile | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 38f67b3..c45232f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,9 @@ RUN --mount=type=cache,target=/var/cache/apt \ rm /usr/bin/python3 &&\ ln -s /usr/bin/python3.10 /usr/bin/python3 &&\ # Create a fake system Python pointing at venv python - echo 'exec /opt/venv/bin/python3.10 "$@"' > /usr/bin/python &&\ + printf "#!/bin/bash\n/opt/venv/bin/python3.10 \"\$@\"" > /usr/bin/python &&\ + #echo 'exec /opt/venv/bin/python3.10 "$@"' > /usr/bin/python &&\ + chmod +x /usr/bin/python &&\ # Configure RStudio Server to run without auth echo "auth-none=1" >> /etc/rstudio/rserver.conf &&\ echo "USER=rstudio" >> /etc/environment &&\ diff --git a/justfile b/justfile index afc71bc..43312de 100644 --- a/justfile +++ b/justfile @@ -8,4 +8,4 @@ build: docker build . -t research-template smoke-test: - docker run --rm research-template ls /opt/venv/bin/python3.10 \ No newline at end of file + docker run --rm research-template python --version \ No newline at end of file