From e9b3a578125cb9c62f229c24da3c196213ed4c10 Mon Sep 17 00:00:00 2001 From: Tasko Olevski Date: Sat, 23 Nov 2024 14:41:05 +0100 Subject: [PATCH] fix: save extensions in workdir --- docker/vscode/base.Dockerfile | 6 ++++-- docker/vscode/entrypoint.sh | 12 ++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 docker/vscode/entrypoint.sh diff --git a/docker/vscode/base.Dockerfile b/docker/vscode/base.Dockerfile index f37a4ac0..dae29ff6 100644 --- a/docker/vscode/base.Dockerfile +++ b/docker/vscode/base.Dockerfile @@ -11,6 +11,8 @@ RUN apt-get update && \ rm -rf /var/lib/apt/lists/* USER ${SESSION_USER} +COPY entrypoint.sh /entrypoint.sh WORKDIR ${WORKDIR} -ENTRYPOINT ["tini", "--", "sh", "-c"] -CMD ["/codium-server/bin/codium-server --server-base-path $RENKU_BASE_URL_PATH/ --without-connection-token --host 0.0.0.0 --port 8888"] +# We are setting this to a weird double underscore name to avoid collisions with user-set vars +ENV __WORKDIR__=${WORKDIR} +ENTRYPOINT ["tini", "--", "/bin/bash", "/entrypoint.sh"] diff --git a/docker/vscode/entrypoint.sh b/docker/vscode/entrypoint.sh new file mode 100644 index 00000000..ff32bd5e --- /dev/null +++ b/docker/vscode/entrypoint.sh @@ -0,0 +1,12 @@ +set -ex +WORKDIR=${__WORKDIR__} +mkdir -p "${WORKDIR}/.vscode/extensions" +/codium-server/bin/codium-server \ + --server-base-path "$RENKU_BASE_URL_PATH/" \ + --without-connection-token \ + --host 0.0.0.0 \ + --port 8888 \ + --extensions-dir "${WORKDIR}/.vscode/extensions" \ + --accept-server-license-terms \ + --telemetry-level off \ + --server-data-dir "${WORKDIR}/.vscode"