Skip to content

Commit d071735

Browse files
committed
Pre-install some extensions on code-server notebook
1 parent 50e11ac commit d071735

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

codeserver/ubi9-python-3.9/Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ WORKDIR /opt/app-root/bin
2121
RUN yum install -y "https://github.com/coder/code-server/releases/download/${CODESERVER_VERSION}/code-server-${CODESERVER_VERSION/v/}-amd64.rpm" && \
2222
yum -y clean all --enablerepo='*'
2323

24+
# Change ownership of relevant directories
25+
RUN chmod -R g+w /opt/app-root/lib/python3.9/site-packages && \
26+
fix-permissions /opt/app-root -P
27+
2428
# Install NGINX to proxy VSCode and pass probes check
2529
ENV NGINX_VERSION=1.22 \
2630
NGINX_SHORT_VER=122 \
@@ -78,8 +82,8 @@ COPY nginx/httpconf/ /opt/app-root/etc/nginx.d/
7882
COPY nginx/api/ /opt/app-root/api/
7983

8084
# Launcher
81-
COPY utils utils/
82-
COPY run-code-server.sh run-nginx.sh ./
85+
COPY --chown=1001:0 utils utils/
86+
COPY --chown=1001:0 run-code-server.sh run-nginx.sh ./
8387

8488
ENV SHELL /bin/bash
8589

codeserver/ubi9-python-3.9/run-code-server.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ fi
1616
# Initilize access logs for culling
1717
echo '[{"id":"code-server","name":"code-server","last_activity":"'$(date -Iseconds)'","execution_state":"running","connections":1}]' > /var/log/nginx/vscode.access.log
1818

19+
# Install extensions if not present
20+
if [ ! -f "/opt/app-root/src/.local/share/code-server" ]; then
21+
code-server --install-extension ms-python.python
22+
code-server --install-extension ms-toolsai.jupyter
23+
fi
24+
1925
# Start server
2026
start_process /usr/bin/code-server \
2127
--bind-addr 0.0.0.0:8787 \

0 commit comments

Comments
 (0)