28 lines
651 B
Docker
28 lines
651 B
Docker
|
|
||
|
FROM ubuntu:20.04
|
||
|
|
||
|
RUN apt update && apt install -y --no-install-recommends \
|
||
|
openssh-server sudo \
|
||
|
systemd systemd-sysv dbus dbus-user-session \
|
||
|
software-properties-common
|
||
|
|
||
|
RUN useradd -rm -d /home/ubuntu -s /bin/bash -g root -G sudo -u 1000 ubuntu
|
||
|
|
||
|
RUN echo 'ubuntu:Password123' | chpasswd
|
||
|
RUN echo 'root:root' | chpasswd
|
||
|
RUN printf '#!/bin/sh\nexit 0' > /usr/sbin/policy-rc.d
|
||
|
RUN printf "systemctl start systemd-logind" >> /etc/profile
|
||
|
|
||
|
|
||
|
RUN add-apt-repository "ppa:deadsnakes/ppa"
|
||
|
RUN apt update -y
|
||
|
RUN apt install -y python3.11
|
||
|
|
||
|
RUN service ssh start
|
||
|
|
||
|
EXPOSE 22
|
||
|
|
||
|
CMD ["/bin/bash", "-c", "/sbin/init", "&&", "/usr/sbin/sshd","-D"]
|
||
|
|
||
|
|