FROM rockylinux:8.8 RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == \ systemd-tmpfiles-setup.service ] || rm -f $i; done); \ rm -f /lib/systemd/system/multi-user.target.wants/*;\ rm -f /etc/systemd/system/*.wants/*;\ rm -f /lib/systemd/system/local-fs.target.wants/*; \ rm -f /lib/systemd/system/sockets.target.wants/*udev*; \ rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ rm -f /lib/systemd/system/basic.target.wants/*;\ rm -f /lib/systemd/system/anaconda.target.wants/*; RUN dnf update -y RUN dnf install -y epel-release #RUN dnf install -y NetworkManager #RUN dnf install -y firewalld RUN dnf install -y tzdata RUN dnf install -y cronie RUN dnf install -y rsyslog RUN dnf install -y less RUN dnf install -y man RUN dnf install -y bash-completion RUN dnf install -y net-tools iproute iputils traceroute bind-utils #RUN dnf install -y net-snmp net-snmp-utils RUN dnf install -y lsof RUN dnf install -y python3 RUN dnf install -y sudo RUN dnf install -y which mlocate RUN dnf install -y openssl openssh-server openssh-clients RUN dnf install -y sysstat RUN dnf install -y tree #RUN dnf install -y nmap-ncat #RUN dnf install -y wireshark #RUN dnf install -y tmux RUN dnf install -y passwd RUN dnf install -y procps-ng RUN dnf install -y wget RUN dnf install -y file RUN dnf clean all #WORKDIR /root #RUN mkdir files ENV ssh_pub id_rsa.pub ENV ssh_private id_rsa ENV root_password die4you ENV ssh_config ssh_config COPY ${ssh_pub} /tmp COPY ${ssh_private} /tmp WORKDIR /root RUN rm -rf .ssh RUN mkdir .ssh RUN cat /tmp/${ssh_pub} > .ssh/authorized_keys RUN cp /tmp/${ssh_pub} .ssh/id_rsa.pub RUN cp /tmp/${ssh_private} .ssh/id_rsa RUN chmod 0400 .ssh/authorized_keys RUN chmod 0600 .ssh/id_rsa RUN chmod 0644 .ssh/id_rsa.pub RUN echo ${root_password} | passwd --stdin root #RUN echo root:die4you | chpasswd # disable DNS lookup RUN sed s/.*UseDNS.*/"UseDNS no"/ -i /etc/ssh/sshd_config VOLUME [ "/sys/fs/cgroup" ] #ENTRYPOINT ["/sbin/init"] CMD ["/sbin/init"]