2024-04-03 13:50:17 +00:00
# ORIGINAL REPO https://github.com/damanikjosh/virtualgl-turbovnc-docker/blob/main/Dockerfile
2024-04-03 12:38:36 +00:00
ARG UBUNTU_VERSION = 22 .04
2022-02-01 03:34:19 +00:00
2024-04-03 12:38:36 +00:00
FROM nvidia/opengl:1.2-glvnd-runtime-ubuntu${UBUNTU_VERSION}
2024-04-05 01:49:20 +00:00
LABEL authors = "vajonam, Michael Helfrich - helfrichmichael"
2024-04-03 12:38:36 +00:00
2024-04-03 17:09:07 +00:00
ARG VIRTUALGL_VERSION = 3 .1.1-20240228
ARG TURBOVNC_VERSION = 3 .1.1-20240127
2024-04-03 12:38:36 +00:00
ENV DEBIAN_FRONTEND noninteractive
2024-04-03 17:09:07 +00:00
RUN
2024-04-03 12:38:36 +00:00
# Install some basic dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
2024-04-04 17:46:48 +00:00
wget xorg xauth gosu supervisor x11-xserver-utils libegl1-mesa libgl1-mesa-glx \
locales-all libpam0g libxt6 libxext6 dbus-x11 xauth x11-xkb-utils xkb-data python3 xterm novnc \
2024-04-03 12:38:36 +00:00
lxde gtk2-engines-murrine gnome-themes-standard gtk2-engines-pixbuf gtk2-engines-murrine arc-theme \
freeglut3 libgtk2.0-dev libwxgtk3.0-gtk3-dev libwx-perl libxmu-dev libgl1-mesa-glx libgl1-mesa-dri \
2024-04-04 17:46:48 +00:00
xdg-utils locales locales-all pcmanfm jq curl git bzip2 gpg-agent software-properties-common \
&& mkdir -p /usr/share/desktop-directories \
# Install Firefox without Snap.
&& add-apt-repository ppa:mozillateam/ppa \
&& apt update \
&& apt install -y firefox-esr --no-install-recommends \
# Clean everything up.
2024-04-03 12:59:41 +00:00
&& apt autoclean -y \
&& apt autoremove -y \
2024-04-04 17:46:48 +00:00
&& rm -rf /var/lib/apt/lists/*
2022-02-01 03:34:19 +00:00
2024-04-03 12:38:36 +00:00
# Install virtualgl and turbovnc
2024-04-03 17:09:07 +00:00
RUN wget -qO /tmp/virtualgl_${ VIRTUALGL_VERSION } _amd64.deb https://packagecloud.io/dcommander/virtualgl/packages/any/any/virtualgl_${ VIRTUALGL_VERSION } _amd64.deb/download.deb?distro_version_id= 35\
&& wget -qO /tmp/turbovnc_${ TURBOVNC_VERSION } _amd64.deb https://packagecloud.io/dcommander/turbovnc/packages/any/any/turbovnc_${ TURBOVNC_VERSION } _amd64.deb/download.deb?distro_version_id= 35 \
2024-04-03 12:38:36 +00:00
&& dpkg -i /tmp/virtualgl_${ VIRTUALGL_VERSION } _amd64.deb \
&& dpkg -i /tmp/turbovnc_${ TURBOVNC_VERSION } _amd64.deb \
&& rm -rf /tmp/*.deb
2022-02-01 03:34:19 +00:00
2024-04-03 15:27:16 +00:00
# Install prusaslicer
2022-02-01 03:34:19 +00:00
WORKDIR /slic3r
2022-02-04 23:54:16 +00:00
ADD get_latest_prusaslicer_release.sh /slic3r
2022-02-08 01:21:28 +00:00
RUN chmod +x /slic3r/get_latest_prusaslicer_release.sh \
2022-02-04 23:54:16 +00:00
&& latestSlic3r = $( /slic3r/get_latest_prusaslicer_release.sh url) \
&& slic3rReleaseName = $( /slic3r/get_latest_prusaslicer_release.sh name) \
2022-02-01 03:34:19 +00:00
&& curl -sSL ${ latestSlic3r } > ${ slic3rReleaseName } \
&& rm -f /slic3r/releaseInfo.json \
&& mkdir -p /slic3r/slic3r-dist \
&& tar -xjf ${ slic3rReleaseName } -C /slic3r/slic3r-dist --strip-components 1 \
&& rm -f /slic3r/${ slic3rReleaseName } \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get autoclean \
&& groupadd slic3r \
2022-02-02 02:50:33 +00:00
&& useradd -g slic3r --create-home --home-dir /home/slic3r slic3r \
2022-02-01 03:34:19 +00:00
&& mkdir -p /slic3r \
2022-02-02 02:50:33 +00:00
&& mkdir -p /configs \
2022-02-14 04:06:36 +00:00
&& mkdir -p /prints/ \
&& chown -R slic3r:slic3r /slic3r/ /home/slic3r/ /prints/ /configs/ \
2022-02-01 03:34:19 +00:00
&& locale-gen en_US \
2022-02-02 02:50:33 +00:00
&& mkdir /configs/.local \
2022-02-03 00:12:15 +00:00
&& mkdir -p /configs/.config/ \
2022-02-14 04:06:36 +00:00
&& ln -s /configs/.config/ /home/slic3r/ \
&& mkdir -p /home/slic3r/.config/ \
&& echo "XDG_DOWNLOAD_DIR=\"/prints/\"" >> /home/slic3r/.config/user-dirs.dirs \
2024-04-04 17:46:48 +00:00
&& echo "file:///prints prints" >> /home/slic3r/.gtk-bookmarks
2024-04-03 12:38:36 +00:00
2024-04-03 15:36:06 +00:00
# Generate key for novnc and cleanup erros
RUN openssl req -x509 -nodes -newkey rsa:2048 -keyout /etc/novnc.pem -out /etc/novnc.pem -days 365 -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=localhost" \
&& rm /etc/xdg/autostart/lxpolkit.desktop \
&& mv /usr/bin/lxpolkit /usr/bin/lxpolkit.ORIG
2024-04-03 12:38:36 +00:00
ENV PATH ${ PATH } :/opt/VirtualGL/bin:/opt/TurboVNC/bin
2024-04-03 15:36:06 +00:00
ADD entrypoint.sh /entrypoint.sh
ADD supervisord.conf /etc/
2024-04-04 15:04:18 +00:00
# Add a default file to resize, etc for noVNC.
ADD vncresize.html /usr/share/novnc/index.html
2024-05-19 05:09:58 +00:00
ADD icons/prusaslicer-16x16.png /usr/share/novnc/app/images/icons/novnc-16x16.png
ADD icons/prusaslicer-24x24.png /usr/share/novnc/app/images/icons/novnc-24x24.png
ADD icons/prusaslicer-32x32.png /usr/share/novnc/app/images/icons/novnc-32x32.png
ADD icons/prusaslicer-48x48.png /usr/share/novnc/app/images/icons/novnc-48x48.png
ADD icons/prusaslicer-60x60.png /usr/share/novnc/app/images/icons/novnc-60x60.png
ADD icons/prusaslicer-64x64.png /usr/share/novnc/app/images/icons/novnc-64x64.png
ADD icons/prusaslicer-72x72.png /usr/share/novnc/app/images/icons/novnc-72x72.png
ADD icons/prusaslicer-76x76.png /usr/share/novnc/app/images/icons/novnc-76x76.png
ADD icons/prusaslicer-96x96.png /usr/share/novnc/app/images/icons/novnc-96x96.png
ADD icons/prusaslicer-120x120.png /usr/share/novnc/app/images/icons/novnc-120x120.png
ADD icons/prusaslicer-144x144.png /usr/share/novnc/app/images/icons/novnc-144x144.png
ADD icons/prusaslicer-152x152.png /usr/share/novnc/app/images/icons/novnc-152x152.png
ADD icons/prusaslicer-192x192.png /usr/share/novnc/app/images/icons/novnc-192x192.png
2023-07-01 03:54:28 +00:00
2024-05-19 05:09:58 +00:00
# Set firefox to run with hardware accel as if enabled.
2024-04-05 14:08:06 +00:00
RUN sed -i 's|exec $MOZ_LIBDIR/$MOZ_APP_NAME "$@"|if [ -n "$ENABLEHWGPU" ] \&\& [ "$ENABLEHWGPU" = "true" ]; then\n exec /usr/bin/vglrun $MOZ_LIBDIR/$MOZ_APP_NAME "$@"\nelse\n exec $MOZ_LIBDIR/$MOZ_APP_NAME "$@"\nfi|g' /usr/bin/firefox-esr
2024-04-05 14:09:49 +00:00
2022-02-02 02:50:33 +00:00
VOLUME /configs/
2022-02-14 04:06:36 +00:00
VOLUME /prints/
2022-02-01 03:34:19 +00:00
2024-04-03 12:38:36 +00:00
ENTRYPOINT [ "/entrypoint.sh" ]