Dockerfile 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. FROM nvidia/opengl:1.2-glvnd-runtime-ubuntu20.04
  2. # Comment the line above and uncomment the line below for Ubuntu 18.04
  3. #FROM nvidia/opengl:1.2-glvnd-runtime-ubuntu18.04
  4. LABEL maintainer "https://github.com/ehfd"
  5. # Make all NVIDIA GPUs visible, but we want to manually install drivers
  6. ARG NVIDIA_VISIBLE_DEVICES=all
  7. # Supress interactive menu while installing keyboard-configuration
  8. ARG DEBIAN_FRONTEND=noninteractive
  9. ENV NVIDIA_DRIVER_CAPABILITIES all
  10. # Default options (password is "mypasswd")
  11. ENV TZ UTC
  12. ENV PASSWD mypasswd
  13. ENV SIZEW 1920
  14. ENV SIZEH 1080
  15. ENV CDEPTH 24
  16. ENV VIDEO_PORT DFP
  17. # Install locales to prevent errors
  18. RUN apt-get clean && \
  19. apt-get update && \
  20. apt-get install -y --no-install-recommends locales && \
  21. rm -rf /var/lib/apt/lists/* && \
  22. locale-gen en_US.UTF-8
  23. ENV LANG en_US.UTF-8
  24. ENV LANGUAGE en_US:en
  25. ENV LC_ALL en_US.UTF-8
  26. # Install Xorg, MATE desktop, and others
  27. RUN dpkg --add-architecture i386 && \
  28. apt-get update && apt-get install -y \
  29. software-properties-common \
  30. apt-utils \
  31. build-essential \
  32. ca-certificates \
  33. kmod \
  34. libc6:i386 \
  35. libc6-dev \
  36. curl \
  37. file \
  38. wget \
  39. gzip \
  40. zip \
  41. unzip \
  42. gcc \
  43. git \
  44. make \
  45. python \
  46. python-numpy \
  47. python3 \
  48. python3-numpy \
  49. mlocate \
  50. nano \
  51. vim \
  52. htop \
  53. firefox \
  54. supervisor \
  55. net-tools \
  56. libpci3 \
  57. libelf-dev \
  58. libglvnd-dev \
  59. pkg-config \
  60. mesa-utils \
  61. libglu1 \
  62. libglu1:i386 \
  63. libsm6 \
  64. libxv1 \
  65. libxv1:i386 \
  66. libxtst6 \
  67. libxtst6:i386 \
  68. x11-xkb-utils \
  69. x11-xserver-utils \
  70. x11-apps \
  71. dbus-x11 \
  72. libdbus-c++-1-0v5 \
  73. xauth \
  74. xinit \
  75. xfonts-base \
  76. xkb-data \
  77. libxrandr-dev \
  78. xorg-dev \
  79. ubuntu-mate-desktop && \
  80. if [ "$(grep VERSION_CODENAME= /etc/os-release | cut -d= -f2)" = "bionic" ]; then apt-get install -y --no-install-recommends vulkan-utils; else apt-get install -y --no-install-recommends vulkan-tools; fi && \
  81. # Remove Bluetooth packages that throw errors
  82. apt-get autoremove --purge -y blueman bluez bluez-cups pulseaudio-module-bluetooth && \
  83. rm -rf /var/lib/apt/lists/*
  84. # Wine and Winetricks, comment out the below lines to disable
  85. ARG WINE_BRANCH=stable
  86. RUN if [ "$(grep VERSION_CODENAME= /etc/os-release | cut -d= -f2)" = "bionic" ]; then add-apt-repository ppa:cybermax-dexter/sdl2-backport; fi && \
  87. curl -fsSL https://dl.winehq.org/wine-builds/winehq.key | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - && \
  88. apt-add-repository "deb https://dl.winehq.org/wine-builds/ubuntu/ $(grep VERSION_CODENAME= /etc/os-release | cut -d= -f2) main" && \
  89. apt-get update && apt-get install -y --install-recommends winehq-${WINE_BRANCH} && \
  90. rm -rf /var/lib/apt/lists/* && \
  91. curl -fsSL -o /usr/bin/winetricks https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks && \
  92. chmod 755 /usr/bin/winetricks && \
  93. curl -fsSL -o /usr/share/bash-completion/completions/winetricks https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks.bash-completion
  94. # Apache Guacamole and x11vnc
  95. ENV TOMCAT_VERSION 9.0.50
  96. RUN apt-get update && apt-get install -y --no-install-recommends \
  97. libcairo2-dev \
  98. libjpeg-turbo8-dev \
  99. libpng-dev \
  100. libtool-bin \
  101. libossp-uuid-dev \
  102. libavcodec-dev \
  103. libavformat-dev \
  104. libavutil-dev \
  105. libswscale-dev \
  106. freerdp2-dev \
  107. libpango1.0-dev \
  108. libssh2-1-dev \
  109. libtelnet-dev \
  110. libvncserver-dev \
  111. libwebsockets-dev \
  112. libpulse-dev \
  113. libssl-dev \
  114. libvorbis-dev \
  115. libwebp-dev \
  116. autoconf \
  117. automake \
  118. autotools-dev \
  119. pulseaudio \
  120. pavucontrol \
  121. openssh-server \
  122. openssh-sftp-server \
  123. default-jdk \
  124. maven \
  125. libxdamage-dev \
  126. libxinerama-dev \
  127. libxrandr-dev \
  128. libxss-dev \
  129. libxtst-dev \
  130. libv4l-dev \
  131. libavahi-client-dev \
  132. chrpath \
  133. debhelper && \
  134. rm -rf /var/lib/apt/lists/* && \
  135. git clone https://github.com/LibVNC/x11vnc.git /tmp/x11vnc && \
  136. cd /tmp/x11vnc && autoreconf -fi && ./configure && make install && cd / && rm -rf /tmp/* && \
  137. curl -fsSL https://archive.apache.org/dist/tomcat/tomcat-$(echo $TOMCAT_VERSION | cut -d "." -f 1)/v${TOMCAT_VERSION}/bin/apache-tomcat-${TOMCAT_VERSION}.tar.gz | tar -xzf - -C /opt && \
  138. mv /opt/apache-tomcat-$TOMCAT_VERSION /opt/tomcat && \
  139. git clone https://github.com/apache/guacamole-server.git /tmp/guacamole-server && \
  140. cd /tmp/guacamole-server && autoreconf -fi && ./configure --with-init-dir=/etc/init.d && make install && ldconfig && cd / && rm -rf /tmp/* && \
  141. git clone https://github.com/apache/guacamole-client.git /tmp/guacamole-client && \
  142. cd /tmp/guacamole-client && JAVA_HOME=/usr/lib/jvm/default-java mvn package && rm -rf /opt/tomcat/webapps/* && mv guacamole/target/guacamole*.war /opt/tomcat/webapps/ROOT.war && chmod +x /opt/tomcat/webapps/ROOT.war && cd / && rm -rf /tmp/* && \
  143. echo "load-module module-native-protocol-tcp auth-ip-acl=127.0.0.0/8 auth-anonymous=1" >> /etc/pulse/default.pa
  144. # Create user with password ${PASSWD}
  145. RUN apt-get update && apt-get install -y --no-install-recommends \
  146. sudo && \
  147. rm -rf /var/lib/apt/lists/* && \
  148. groupadd -g 1000 user && \
  149. useradd -ms /bin/bash user -u 1000 -g 1000 && \
  150. usermod -a -G adm,audio,cdrom,dialout,dip,fax,floppy,input,lp,lpadmin,netdev,plugdev,scanner,ssh,sudo,tape,tty,video,voice user && \
  151. echo "user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
  152. chown -R user:user /home/user /opt/tomcat && \
  153. echo "user:${PASSWD}" | chpasswd && \
  154. ln -snf "/usr/share/zoneinfo/$TZ" /etc/localtime && echo "$TZ" > /etc/timezone
  155. COPY entrypoint.sh /etc/entrypoint.sh
  156. RUN chmod 755 /etc/entrypoint.sh
  157. COPY supervisord.conf /etc/supervisord.conf
  158. RUN chmod 755 /etc/supervisord.conf
  159. EXPOSE 8080
  160. USER user
  161. WORKDIR /home/user
  162. ENTRYPOINT ["/usr/bin/supervisord"]