From d07173541d4b3de9afb281989a63f62e400f8031 Mon Sep 17 00:00:00 2001 From: atheo89 Date: Wed, 15 Nov 2023 12:43:40 +0100 Subject: [PATCH] Pre-install some extensions on code-server notebook --- codeserver/ubi9-python-3.9/Dockerfile | 8 ++++++-- codeserver/ubi9-python-3.9/run-code-server.sh | 6 ++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/codeserver/ubi9-python-3.9/Dockerfile b/codeserver/ubi9-python-3.9/Dockerfile index d75c89ec9..c6f304ce2 100644 --- a/codeserver/ubi9-python-3.9/Dockerfile +++ b/codeserver/ubi9-python-3.9/Dockerfile @@ -21,6 +21,10 @@ WORKDIR /opt/app-root/bin RUN yum install -y "https://github.com/coder/code-server/releases/download/${CODESERVER_VERSION}/code-server-${CODESERVER_VERSION/v/}-amd64.rpm" && \ yum -y clean all --enablerepo='*' +# Change ownership of relevant directories +RUN chmod -R g+w /opt/app-root/lib/python3.9/site-packages && \ + fix-permissions /opt/app-root -P + # Install NGINX to proxy VSCode and pass probes check ENV NGINX_VERSION=1.22 \ NGINX_SHORT_VER=122 \ @@ -78,8 +82,8 @@ COPY nginx/httpconf/ /opt/app-root/etc/nginx.d/ COPY nginx/api/ /opt/app-root/api/ # Launcher -COPY utils utils/ -COPY run-code-server.sh run-nginx.sh ./ +COPY --chown=1001:0 utils utils/ +COPY --chown=1001:0 run-code-server.sh run-nginx.sh ./ ENV SHELL /bin/bash diff --git a/codeserver/ubi9-python-3.9/run-code-server.sh b/codeserver/ubi9-python-3.9/run-code-server.sh index 6f69f1d76..2562b072a 100755 --- a/codeserver/ubi9-python-3.9/run-code-server.sh +++ b/codeserver/ubi9-python-3.9/run-code-server.sh @@ -16,6 +16,12 @@ fi # Initilize access logs for culling echo '[{"id":"code-server","name":"code-server","last_activity":"'$(date -Iseconds)'","execution_state":"running","connections":1}]' > /var/log/nginx/vscode.access.log +# Install extensions if not present +if [ ! -f "/opt/app-root/src/.local/share/code-server" ]; then + code-server --install-extension ms-python.python + code-server --install-extension ms-toolsai.jupyter +fi + # Start server start_process /usr/bin/code-server \ --bind-addr 0.0.0.0:8787 \