diff options
Diffstat (limited to 'docker_build/Dockerfile')
| -rw-r--r-- | docker_build/Dockerfile | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/docker_build/Dockerfile b/docker_build/Dockerfile new file mode 100644 index 0000000..644b18f --- /dev/null +++ b/docker_build/Dockerfile | |||
| @@ -0,0 +1,50 @@ | |||
| 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 | |||
| 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 | |||
| 23 | # Copy SSH public keys from ssh-keys directory into the image | ||
| 24 | COPY ssh-keys/*.pub /tmp/ssh-keys/ | ||
| 25 | RUN cat /tmp/ssh-keys/*.pub > /root/.ssh/authorized_keys && \ | ||
| 26 | chmod 600 /root/.ssh/authorized_keys && \ | ||
| 27 | rm -rf /tmp/ssh-keys | ||
| 28 | |||
| 29 | # Configure vim | ||
| 30 | COPY docker_build/vimrc /etc/vimrc | ||
| 31 | |||
| 32 | # Configure bash prompt and colors | ||
| 33 | RUN echo 'LS_COLORS=$LS_COLORS:"di=38;5;135:ex=00;32:" ; export LS_COLORS' >> /etc/bashrc && \ | ||
| 34 | echo 'PS1="[\[\033[01;32m\]\u\[\033[00m\]@\h \[\033[38;5;135m\]\W\[\033[00m\]]\$ "' >> /etc/bashrc && \ | ||
| 35 | echo 'export PATH=$PATH:/root/.cargo/bin' >> /root/.bashrc | ||
| 36 | |||
| 37 | # Install Rust and tools for root | ||
| 38 | RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \ | ||
| 39 | echo '[ -f "$HOME/.cargo/env" ] && source "$HOME/.cargo/env"' >> ~/.bashrc && \ | ||
| 40 | source "$HOME/.cargo/env" && \ | ||
| 41 | cargo install cargo-clone-crate cargo-edit cargo-info evcxr_jupyter bacon du-dust | ||
| 42 | |||
| 43 | # Set working directory | ||
| 44 | WORKDIR /root | ||
| 45 | |||
| 46 | # Expose SSH port | ||
| 47 | EXPOSE 22 | ||
| 48 | |||
| 49 | # Start SSH daemon | ||
| 50 | CMD ["/usr/sbin/sshd", "-D", "-e"] \ No newline at end of file | ||
