diff options
Diffstat (limited to 'containers/docker_build/Dockerfile')
| -rw-r--r-- | containers/docker_build/Dockerfile | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/containers/docker_build/Dockerfile b/containers/docker_build/Dockerfile new file mode 100644 index 0000000..16f74d6 --- /dev/null +++ b/containers/docker_build/Dockerfile | |||
| @@ -0,0 +1,61 @@ | |||
| 1 | FROM rockylinux:9 | ||
| 2 | |||
| 3 | # Install required packages, resolving curl conflict | ||
| 4 | RUN dnf install -y epel-release | ||
| 5 | RUN dnf install -y --allowerasing openssh-server sudo procps-ng \ | ||
| 6 | gcc gcc-c++ make cmake pkg-config openssl-devel libicu-devel perl python3-devel \ | ||
| 7 | nc openssl bat autossh tmux htop tar bmon gzip tree wget \ | ||
| 8 | nano vim unzip net-tools git python3 python3-pip make wireguard-tools usbutils yum xclip \ | ||
| 9 | && dnf clean all | ||
| 10 | |||
| 11 | # Configure SSH | ||
| 12 | RUN mkdir -p /var/run/sshd && \ | ||
| 13 | ssh-keygen -A && \ | ||
| 14 | sed -i 's/#PubkeyAuthentication yes/PubkeyAuthentication yes/' /etc/ssh/sshd_config && \ | ||
| 15 | sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config && \ | ||
| 16 | sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config && \ | ||
| 17 | echo "AllowAgentForwarding yes" >> /etc/ssh/sshd_config | ||
| 18 | # Setup SSH directory for root and ensure root has valid shell | ||
| 19 | RUN mkdir -p /root/.ssh && \ | ||
| 20 | chmod 700 /root/.ssh && \ | ||
| 21 | usermod -s /bin/bash root | ||
| 22 | # Copy SSH public keys from docker_build/ssh-keys directory into the image | ||
| 23 | COPY docker_build/ssh-keys/*.pub /tmp/ssh-keys/ | ||
| 24 | RUN cat /tmp/ssh-keys/*.pub > /root/.ssh/authorized_keys && \ | ||
| 25 | chmod 600 /root/.ssh/authorized_keys && \ | ||
| 26 | rm -rf /tmp/ssh-keys | ||
| 27 | |||
| 28 | # Configure vim | ||
| 29 | COPY docker_build/vimrc /etc/vimrc | ||
| 30 | |||
| 31 | # Configure bash prompt and colors | ||
| 32 | RUN echo 'LS_COLORS=$LS_COLORS:"di=38;5;135:ex=00;32:" ; export LS_COLORS' >> /etc/bashrc && \ | ||
| 33 | echo 'PS1="[\[\033[01;32m\]\u\[\033[00m\]@\h \[\033[38;5;135m\]\W\[\033[00m\]]\$ "' >> /etc/bashrc && \ | ||
| 34 | echo 'export PATH=$PATH:/root/.cargo/bin' >> /root/.bashrc | ||
| 35 | |||
| 36 | # Install Rust and tools for root | ||
| 37 | RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \ | ||
| 38 | echo '[ -f "$HOME/.cargo/env" ] && source "$HOME/.cargo/env"' >> ~/.bashrc && \ | ||
| 39 | source "$HOME/.cargo/env" && \ | ||
| 40 | cargo install cargo-clone-crate cargo-edit cargo-info evcxr_jupyter bacon du-dust | ||
| 41 | |||
| 42 | # Install Node.js via nvm and claude-code | ||
| 43 | RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash && \ | ||
| 44 | export NVM_DIR="$HOME/.nvm" && \ | ||
| 45 | [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ | ||
| 46 | nvm install 22 && \ | ||
| 47 | npm install -g @anthropic-ai/claude-code | ||
| 48 | |||
| 49 | # Add nvm to bashrc for future sessions | ||
| 50 | RUN echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.bashrc && \ | ||
| 51 | echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> ~/.bashrc && \ | ||
| 52 | echo '[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"' >> ~/.bashrc | ||
| 53 | |||
| 54 | # Set working directory | ||
| 55 | WORKDIR /root | ||
| 56 | |||
| 57 | # Expose SSH port | ||
| 58 | EXPOSE 22 | ||
| 59 | |||
| 60 | # Start SSH daemon | ||
| 61 | CMD ["/usr/sbin/sshd", "-D", "-e"] | ||
