From 1f899b4bc2c2ebc3c6b711dea625deecff5f839f Mon Sep 17 00:00:00 2001 From: Jon Massey Date: Mon, 20 May 2024 22:10:44 +0100 Subject: [PATCH] Add MOTD to be echoed in every bash shell Many of our users may be unfamiliar with VS Code and specifically using its integrated terminal. These messages aim to reassure the users that this terminal (which is open by default in Codespaces) that it behaves like the terminal they would usually use for OpenSAFELY CLI and to remind them where they can get help. --- Dockerfile | 5 +++++ motd | 10 ++++++++++ 2 files changed, 15 insertions(+) create mode 100644 motd diff --git a/Dockerfile b/Dockerfile index c4ed208..9dc1383 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,6 +26,8 @@ RUN --mount=type=cache,target=/var/cache/apt \ echo 'exec /opt/venv/bin/python3.10 "$@"' > /usr/bin/python &&\ # Activate the venv in every terminal echo "source /opt/venv/bin/activate" >> /home/rstudio/.bashrc &&\ + # Print the MOTD/help text in every shell + echo "cat /etc/motd" >> /home/rstudio/.bashrc &&\ # Configure RStudio Server to run without auth echo "auth-none=1" >> /etc/rstudio/rserver.conf &&\ echo "USER=rstudio" >> /etc/environment &&\ @@ -47,6 +49,9 @@ COPY --chown=rstudio:rstudio --from=ghcr.io/opensafely-core/python:v2 /opt/venv # hadolint ignore=DL3022 COPY --chown=rstudio:rstudio --from=ghcr.io/opensafely-core/r:latest /renv/lib/R-4.0/x86_64-pc-linux-gnu/ /usr/local/lib/R/site-library +# copy in the MOTD file containing the required help text +COPY motd /etc/motd + # Required for installing opensafely cli ENV PATH="/home/rstudio/.local/bin:${PATH}" diff --git a/motd b/motd new file mode 100644 index 0000000..5f219ac --- /dev/null +++ b/motd @@ -0,0 +1,10 @@ +This is an OpenSAFELY Codespace + +All 'opensafely' commands (e.g 'opensafely run', 'opensafely exec') are availble +in this terminal. + +The latest version of ehrQL has been installed, and the Python and R libraries installed +here are the same as those available in the corresponding OpenSAFELY actions. + +Additional help is available in the #opensafely-users Slack channel and at +https://docs.opensafely.org/getting-started/how-to/use-github-codespaces-in-your-project/