docker-ansible-testing/Dockerfile

28 lines
651 B
Docker
Raw Permalink Normal View History

2024-12-23 13:04:49 -05:00
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"]