FROM ubuntu:xenial RUN cd /lib/systemd/system/sysinit.target.wants/; ls | grep -v systemd-tmpfiles-setup | xargs rm -f $1 \ 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/*; \ rm -f /lib/systemd/system/plymouth*; \ rm -f /lib/systemd/system/systemd-update-utmp*; RUN apt-get update && apt-get install -y openssh-server dbus && apt-get clean RUN systemctl set-default multi-user.target COPY ami-spec.pub /root/.ssh/authorized_keys EXPOSE 22 CMD ["/bin/bash", "-c", "exec /sbin/init --log-target=journal 3>&1"]