FROM dorowu/ubuntu-desktop-lxde-vnc LABEL maintainer="ikko@hosei.ac.jp" ENV DEBCONF_NOWARNINGS=yes ENV DEBIAN_FRONTEND noninteractive ENV USERNAME kbkn ENV USERPASS kobaken ENV HOME /home/$USERNAME SHELL ["/bin/bash", "-c"] RUN sed -i 's@archive.ubuntu.com@ftp.jaist.ac.jp/pub/Linux@g' /etc/apt/sources.list && \ useradd -m $USERNAME && \ echo "$USERNAME:$USERPASS" | chpasswd && \ usermod --shell /bin/bash $USERNAME && \ usermod -aG sudo $USERNAME && \ mkdir -p /etc/sudoers.d && \ echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/$USERNAME && \ chmod 0440 /etc/sudoers.d/$USERNAME && \ # Replace 1000 with your user/group id usermod --uid 1000 $USERNAME && \ groupmod --gid 1000 $USERNAME && \ mkdir -p /home/$USERNAME/.cache && \ mkdir -p /home/$USERNAME/.config && \ chown -Rf $USERNAME.$USERNAME /home/$USERNAME && \ apt-get update && \ apt-get upgrade -y && \ apt-get install --no-install-recommends -y \ build-essential \ dkms wget git \ python3-dev python3-pip libglib2.0-dev \ libbluetooth-* \ nano gedit \ libsdl1.2-dev \ libsdl-image1.2-dev \ libsdl-mixer1.2-dev \ libsdl-ttf2.0-dev \ libsdl-gfx1.2-dev \ cmake libpulse-mainloop-glib0 \ bluez* blueman \ openssh-server && \ apt-get autoremove -y && \ apt-get -y clean && \ rm -rf /var/lib/apt/lists/* && \ mkdir -p /var/run/sshd && \ echo 'root:kobaken' | chpasswd && \ sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config && \ sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd && \ mkdir -p /home/$USERNAME && \ cd /home/$USERNAME && \ git clone https://github.com/wiiuse/wiiuse.git && \ pip3 install bluepy datetime && \ cd /home/$USERNAME/wiiuse && \ mkdir build && \ cd build && \ cmake .. && \ make RUN apt-get update && apt-get install -y --no-install-recommends \ dbus-x11 \ libdbus-c++-1-0v5 && \ rm -rf /var/lib/apt/lists/* && \ chown kbkn.kbkn -R /home/$USERNAME/wiiuse EXPOSE 22 COPY ./startup.sh /startup.sh RUN echo "alias m='cd /home/$USERNAME ; su $USERNAME'" >> /root/.bashrc CMD ["bash", "/startup.sh"]