FROM ubuntu:latest # for a specific version of ubuntu use a tag like ubuntu:20.04 or similar COPY files/preseed.txt /tmp/preseed.txt RUN debconf-set-selections /tmp/preseed.txt &&\ export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true &&\ apt-get update &&\ apt-get install -y openssh-server adminer mariadb-server sudo RUN a2enconf adminer # create default user "jdoe" RUN useradd -rm -d /home/jdoe -s /bin/bash -G sudo,www-data jdoe RUN echo 'jdoe:jdpasswd' | chpasswd # set permissoins to /var/www and create symlink COPY files/phpinfo.php /var/www/html/phpinfo.php RUN chown -R jdoe.jdoe /var/www RUN ln -s /var/www /home/jdoe/www # clean up apt cache RUN apt-get autoclean -y &&\ apt-get autoremove -y &&\ rm -rf /var/lib/apt/lists/* # startup script COPY files/startup.sh /usr/local/bin/startup.sh CMD /bin/bash /usr/local/bin/startup.sh EXPOSE 22 80