From 77a759a3a1df9440e61a43b039e806c3adee3190 Mon Sep 17 00:00:00 2001 From: ub Date: Fri, 6 Feb 2026 08:30:37 +0800 Subject: [PATCH] Document nvm install and add proxy setup --- README.md | 4 ++++ docker-compose.yaml | 1 - init.d/run.sh | 42 ++++++++++++++++++++---------------------- 3 files changed, 24 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index dd994af..358d137 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ ```shell docker exec -it code-server /init.d/run.sh +``` + +```shell +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bash ``` \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml index 5037184..d2ca830 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,4 +1,3 @@ ---- services: code-server: image: lscr.io/linuxserver/code-server:latest diff --git a/init.d/run.sh b/init.d/run.sh index a07401e..8069c24 100755 --- a/init.d/run.sh +++ b/init.d/run.sh @@ -5,6 +5,25 @@ apt update apt install -y openssh-server vim ca-certificates curl gnupg +# Configure system-wide proxy for this container. +PROXY_URL="http://10.8.0.1:7890" +cat >/etc/apt/apt.conf.d/99proxy </etc/profile.d/proxy.sh </dev/null 2>&1; then + git config --system http.proxy "${PROXY_URL}" + git config --system https.proxy "${PROXY_URL}" +fi + # Install Docker CLI only (docker-ce-cli) from official Docker repo. install -m 0755 -d /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc @@ -35,25 +54,4 @@ if [[ -f "${SCRIPT_DIR}/authorized_keys" ]]; then install -m 600 "${SCRIPT_DIR}/authorized_keys" /root/.ssh/authorized_keys fi -cp /init.d/init.sh /init - -curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bash - -# Configure system-wide proxy for this container. -PROXY_URL="http://10.8.0.1:7890" -cat >/etc/apt/apt.conf.d/99proxy </etc/profile.d/proxy.sh </dev/null 2>&1; then - git config --system http.proxy "${PROXY_URL}" - git config --system https.proxy "${PROXY_URL}" -fi \ No newline at end of file +cp /init.d/init.sh /init \ No newline at end of file