From ce511f49438761549e904d6e972b8c0635306ff9 Mon Sep 17 00:00:00 2001 From: hc Date: Sat, 31 May 2025 15:16:23 +0800 Subject: updateddocsandaddedclaudecode --- docker_build/Dockerfile | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'docker_build') diff --git a/docker_build/Dockerfile b/docker_build/Dockerfile index f5d0a46..5df57d2 100644 --- a/docker_build/Dockerfile +++ b/docker_build/Dockerfile @@ -15,12 +15,10 @@ RUN mkdir -p /var/run/sshd && \ sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config && \ sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config && \ echo "AllowAgentForwarding yes" >> /etc/ssh/sshd_config - # Setup SSH directory for root and ensure root has valid shell RUN mkdir -p /root/.ssh && \ chmod 700 /root/.ssh && \ usermod -s /bin/bash root - # Copy SSH public keys from ssh-keys directory into the image COPY ssh-keys/*.pub /tmp/ssh-keys/ RUN cat /tmp/ssh-keys/*.pub > /root/.ssh/authorized_keys && \ @@ -41,6 +39,18 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \ source "$HOME/.cargo/env" && \ cargo install cargo-clone-crate cargo-edit cargo-info evcxr_jupyter bacon du-dust +# Install Node.js via nvm and claude-code +RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash && \ + export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + nvm install 22 && \ + npm install -g @anthropic-ai/claude-code + +# Add nvm to bashrc for future sessions +RUN echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.bashrc && \ + echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> ~/.bashrc && \ + echo '[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"' >> ~/.bashrc + # Set working directory WORKDIR /root @@ -48,4 +58,4 @@ WORKDIR /root EXPOSE 22 # Start SSH daemon -CMD ["/usr/sbin/sshd", "-D", "-e"] \ No newline at end of file +CMD ["/usr/sbin/sshd", "-D", "-e"] -- cgit v1.2.3-70-g09d2