chrodev/Dockerfile

43 lines
1.2 KiB
Docker
Raw Permalink Normal View History

2024-07-23 16:40:12 -04:00
FROM ubuntu:latest
RUN apt-get update && apt-get install -y \
openssh-server \
xvfb \
x11vnc \
xfce4 \
xfce4-goodies \
sudo \
2024-07-23 23:25:47 -04:00
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 \
2024-07-24 00:23:36 -04:00
software-properties-common \
2024-07-23 16:40:12 -04:00
&& apt-get clean
2024-07-23 23:25:47 -04:00
2024-07-23 16:40:12 -04:00
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
2024-07-23 23:25:47 -04:00
COPY start_services.sh /usr/local/bin/start_services.sh
2024-07-23 16:40:12 -04:00
EXPOSE 22 5901
CMD ["/usr/sbin/sshd", "-D"]