FROM ubuntu:latest RUN apt-get update && apt-get install -y \ openssh-server \ xvfb \ x11vnc \ xfce4 \ xfce4-goodies \ sudo \ pulseaudio \ gstreamer1.0-tools gstreamer1.0-plugins-good \ gstreamer1.0-plugins-bad \ gstreamer1.0-plugins-ugly \ tigervnc-standalone-server tigervnc-common \ alsa dbus \ nano vim \ software-properties-common \ && apt-get clean RUN mkdir /var/run/sshd RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin prohibit-password/' /etc/ssh/sshd_config # SSH login fix. Otherwise user is kicked off after login RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd # Enable X11 forwarding RUN sed -i 's/#X11UseLocalhost yes/X11UseLocalhost no/' /etc/ssh/sshd_config RUN echo "X11Forwarding yes" >> /etc/ssh/sshd_config RUN echo "AddressFamily inet" >> /etc/ssh/sshd_config ENV NOTVISIBLE "in users profile" RUN echo "export VISIBLE=now" >> /etc/profile # Add script to create user COPY create_ubuntu_user.sh /usr/local/bin/create_ubuntu_user.sh RUN chmod +x /usr/local/bin/create_ubuntu_user.sh COPY start_services.sh /usr/local/bin/start_services.sh EXPOSE 22 5901 CMD ["/usr/sbin/sshd", "-D"]