FROM ubuntu:22.04 MAINTAINER "Hiroki Takeyama" # timezone RUN apt update && apt install -y tzdata; \ apt clean; # sshd RUN mkdir /run/sshd; \ apt install -y openssh-server; \ sed -i 's/^#\(PermitRootLogin\) .*/\1 yes/' /etc/ssh/sshd_config; \ sed -i 's/^\(UsePAM yes\)/# \1/' /etc/ssh/sshd_config; \ apt clean; # entrypoint RUN { \ echo '#!/bin/bash -eu'; \ echo 'echo "root:toor" | chpasswd'; \ echo 'exec "$@"'; \ } > /usr/local/bin/entry_point.sh; \ chmod +x /usr/local/bin/entry_point.sh; ENV TZ Asia/Tokyo ENV ROOT_PASSWORD root EXPOSE 22 CMD ["/usr/sbin/sshd", "-D", "-e"]