31 lines
782 B
Docker
31 lines
782 B
Docker
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"] |