chrodev/Dockerfile

32 lines
943 B
Docker

FROM ubuntu:latest
RUN apt-get update && apt-get install -y \
openssh-server \
xvfb \
x11vnc \
xfce4 \
xfce4-goodies \
sudo \
&& 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
EXPOSE 22 5901
CMD ["/usr/sbin/sshd", "-D"]