Compare commits
9 Commits
main
...
9d6db4bb40
| Author | SHA1 | Date | |
|---|---|---|---|
| 9d6db4bb40 | |||
| e28d5291c3 | |||
|
|
b476a3e2cf | ||
|
|
c8e6646009 | ||
|
|
0be1013d72 | ||
| 3dd0003bcc | |||
|
|
f88c3dba56 | ||
| 9cf9efbdb7 | |||
|
|
cc10132cd3 |
15
nasp-jumpserver/Dockerfile
Normal file
15
nasp-jumpserver/Dockerfile
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
FROM docker.io/alpine
|
||||||
|
|
||||||
|
RUN apk add --no-cache openssh git sudo tmux vim bash zsh curl wget coreutils util-linux tzdata \
|
||||||
|
&& cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo "Asia/Shanghai" > /etc/timezone
|
||||||
|
|
||||||
|
COPY sshd_config /etc/ssh/sshd_config
|
||||||
|
|
||||||
|
RUN cd /opt && git clone https://git.nasp.ob.ac.cn/NASP/registry \
|
||||||
|
&& ./registry/scripts/jumpserver_deploy.sh \
|
||||||
|
&& curl dotfiles.cn | bash -s - -l -u root \
|
||||||
|
&& sed -i 's?root:x:0:0:root:/root:/bin/ash?root:x:0:0:root:/root:/bin/zsh?' /etc/passwd \
|
||||||
|
&& sed -i 's?ssh:x:1000:1000:jumpserver user ssh:/home/ssh:/bin/ash?ssh:x:1000:1000:jumpserver user ssh:/home/ssh:/bin/bash?' /etc/passwd
|
||||||
|
|
||||||
|
EXPOSE 22
|
||||||
|
ENTRYPOINT ["/etc/startup.sh"]
|
||||||
15
nasp-jumpserver/sshd_config
Normal file
15
nasp-jumpserver/sshd_config
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
Port 22
|
||||||
|
|
||||||
|
# Authentication:
|
||||||
|
LoginGraceTime 30s
|
||||||
|
PermitRootLogin prohibit-password
|
||||||
|
StrictModes yes
|
||||||
|
MaxAuthTries 6
|
||||||
|
MaxSessions 10
|
||||||
|
PubkeyAuthentication yes
|
||||||
|
AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys2
|
||||||
|
PasswordAuthentication no
|
||||||
|
AllowAgentForwarding yes
|
||||||
|
|
||||||
|
# override default of no subsystems
|
||||||
|
Subsystem sftp internal-sftp
|
||||||
6
nasp-jumpserver/startup.sh
Executable file
6
nasp-jumpserver/startup.sh
Executable file
@@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
crond
|
||||||
|
/etc/init.d/sshd start
|
||||||
|
bash
|
||||||
23
nasp-ubuntu/Dockerfile
Normal file
23
nasp-ubuntu/Dockerfile
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
FROM docker.io/nvidia/cuda:11.3.1-devel-ubuntu20.04
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
|
||||||
|
&& sed -i "s@http://.*archive.ubuntu.com@http://192.168.16.201/mirrors@g" /etc/apt/sources.list \
|
||||||
|
&& apt-get update -y && DEBIAN_FRONTEND=noninteractive apt-get install -yq \
|
||||||
|
-o Acquire::BrokenProxy="true" -o Acquire::http::No-Cache="true" -o Acquire::http::Pipeline-Depth="0" \
|
||||||
|
build-essential cmake openssh-server git-all sudo ssh sshpass pciutils \
|
||||||
|
python3 python3-dev python3-pip curl ca-certificates vim zsh tmux bash \
|
||||||
|
inetutils-ping less wget dialog net-tools dnsutils netcat traceroute \
|
||||||
|
cron htop zip dkms \
|
||||||
|
&& rm -rf /var/lib/apt/list/*
|
||||||
|
|
||||||
|
# mlnx ofed
|
||||||
|
RUN cd /tmp && wget http://192.168.16.118/MLNX_OFED_LINUX-5.8-2.0.3.0-ubuntu20.04-x86_64.tgz \
|
||||||
|
&& tar -xf MLNX_OFED_LINUX-5.8-2.0.3.0-ubuntu20.04-x86_64.tgz \
|
||||||
|
&& cd MLNX_OFED_LINUX-5.8-2.0.3.0-ubuntu20.04-x86_64 \
|
||||||
|
&& ./mlnxofedinstall --skip-unsupported-devices-check -q \
|
||||||
|
&& rm -rf /tmp/MLNX_OFED_LINUX-5.8-*
|
||||||
|
|
||||||
|
# startup
|
||||||
|
COPY startup.sh /etc/startup.sh
|
||||||
|
ENTRYPOINT ["/etc/startup.sh"]
|
||||||
5
nasp-ubuntu/startup.sh
Executable file
5
nasp-ubuntu/startup.sh
Executable file
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
/etc/init.d/ssh start || echo "Failed to start sshd. Maybe the port is already in use, and please check your sshd_config. This is not an error if it's the first time you run this container."
|
||||||
|
bash
|
||||||
Reference in New Issue
Block a user