This commit is contained in:
Mikan
2026-10-06 02:30:59 +04:00
commit 6cf6e12ed3
8 changed files with 324 additions and 0 deletions

31
ssh/Dockerfile Normal file
View File

@@ -0,0 +1,31 @@
FROM alpine:3.22
RUN apk add --no-cache \
openssh-server \
docker-cli \
docker-cli-compose \
&& addgroup -g 1001 docker-host \
&& adduser -D -s /bin/sh operator \
&& adduser operator docker-host \
&& passwd -d operator \
&& mkdir -p /home/operator/.ssh \
&& ssh-keygen -A
RUN printf '%s\n' \
'PasswordAuthentication no' \
'KbdInteractiveAuthentication no' \
'PubkeyAuthentication yes' \
'PermitRootLogin no' \
>> /etc/ssh/sshd_config
COPY entrypoint.sh /entrypoint.sh
COPY gpuctl /usr/local/bin/gpuctl
RUN sed -i 's/\r$//' /usr/local/bin/gpuctl \
&& chmod +x /entrypoint.sh /usr/local/bin/gpuctl
RUN chmod +x /entrypoint.sh /usr/local/bin/gpuctl
EXPOSE 22
ENTRYPOINT ["/entrypoint.sh"]