Commit 868f3641 authored by hark's avatar hark

vnc

parent 2c9af7b9
Pipeline #1189 failed with stage
# some vitualgl images
* https://hub.docker.com/r/yantis/virtualgl/
# https://raw.githubusercontent.com/alehaa/docker-debian-systemd/master/Dockerfile
# This file is part of docker-debian-systemd.
#
# Copyright (c)
# 2018-2019 Alexander Haase <ahaase@alexhaase.de>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# This image bases on the regular Debian image. By default the 'latest' tag
# (pointing to the current stable release) of the parent image will be used.
# However, an alternate parent tag may be set by defining the 'TAG' build
# argument to a specific Debian release, e.g. 'stretch' or 'buster'.
ARG TAG=latest
FROM debian:${TAG}
# Configure the debconf frontend.
#
# This image doesn't include whiptail, dialog, nor the readline perl module.
# Therefore, the debconf frontend will be set to 'teletype' to avoid error
# messages about no dialog frontend could be found.
RUN echo 'debconf debconf/frontend select teletype' | debconf-set-selections
# Install the necessary packages.
#
# In addition to the regular Debian base image, a BASIC set of packages from the
# Debian minimal configuration will be installed. After all packages have been
# installed, the apt caches and some log files will be removed to minimize the
# image.
#
# NOTE: An upgrade will be performed to include updates and security fixes of
# installed packages that received updates in the Debian repository after
# the upstream image has been created.
#
# NOTE: No syslog daemon will be installed, as systemd's journald should fit
# most needs. Please file an issue if you think this should be changed.
RUN apt-get update
RUN apt-get dist-upgrade -y
RUN apt-get install -y --no-install-recommends \
systemd \
systemd-sysv \
cron \
anacron
RUN apt-get clean
RUN rm -rf \
/var/lib/apt/lists/* \
/var/log/alternatives.log \
/var/log/apt/history.log \
/var/log/apt/term.log \
/var/log/dpkg.log
# Configure systemd.
#
# For running systemd inside a Docker container, some additional tweaks are
# required. For a detailed list see:
#
# https://developers.redhat.com/blog/2016/09/13/ \
# running-systemd-in-a-non-privileged-container/
#
# Additional tweaks will be applied in the final image below.
# To avoid ugly warnings when running this image on a host running systemd, the
# following units will be masked.
#
# NOTE: This will not remove ALL warnings in all Debian releases, but seems to
# work for stretch.
RUN systemctl mask -- \
dev-hugepages.mount \
sys-fs-fuse-connections.mount
# The machine-id should be generated when creating the container. This will be
# done automatically if the file is not present, so let's delete it.
RUN rm -f \
/etc/machine-id \
/var/lib/dbus/machine-id
# Build the final image.
#
# To get a minimal image without deleted files in intermediate layers, the
# contents of the image previously built will be copied into a second version of
# the parent image.
#
# NOTE: This method requires buildkit, as the differ of buildkit will copy
# changed files only and we'll get a minimal image with just the changed
# files in a single new layer.
#
# NOTE: All settings related to the image's environment (e.g. CMD, ENV and
# VOLUME settings) need to be set in the following image definition to be
# used by child images and containers.
FROM debian:${TAG}
COPY --from=0 / /
# Configure systemd.
#
# For running systemd inside a Docker container, some additional tweaks are
# required. Some of them have already been applied above.
#
# The 'container' environment variable tells systemd that it's running inside a
# Docker container environment.
ENV container docker
# A different stop signal is required, so systemd will initiate a shutdown when
# running 'docker stop <container>'.
STOPSIGNAL SIGRTMIN+3
# The host's cgroup filesystem need's to be mounted (read-only) in the
# container. '/run', '/run/lock' and '/tmp' need to be tmpfs filesystems when
# running the container without 'CAP_SYS_ADMIN'.
#
# NOTE: For running Debian stretch, 'CAP_SYS_ADMIN' still needs to be added, as
# stretch's version of systemd is not recent enough. Buster will run just
# fine without 'CAP_SYS_ADMIN'.
VOLUME [ "/sys/fs/cgroup", "/run", "/run/lock", "/tmp" ]
# As this image should run systemd, the default command will be changed to start
# the init system. CMD will be preferred in favor of ENTRYPOINT, so one may
# override it when creating the container to e.g. to run a bash console instead.
CMD [ "/sbin/init" ]
# https://raw.githubusercontent.com/tyson-swetnam/turbovnc-virtualgl-docker/master/Dockerfile
#noVNC + TurboVNC + VirtualGL
# http://novnc.com
# https://turbovnc.org
# https://virtualgl.org
# xhost +si:localuser:root
# openssl req -new -x509 -days 365 -nodes -out self.pem -keyout self.pem
# docker build -t turbovnc .
# docker run --init --runtime=nvidia --name=turbovnc --rm -i -v /tmp/.X11-unix/X0:/tmp/.X11-unix/X0 -p 5901:5901 turbovnc
# docker exec -ti turbovnc vglrun glxspheres64
FROM nvidia/opengl:1.0-glvnd-runtime
ARG TURBOVNC_VERSION=2.1.2
ARG VIRTUALGL_VERSION=2.5.2
ARG LIBJPEG_VERSION=1.5.2
ARG WEBSOCKIFY_VERSION=0.8.0
ARG NOVNC_VERSION=1.0.0-beta
ENV NVIDIA_DRIVER_CAPABILITIES ${NVIDIA_DRIVER_CAPABILITIES},display
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
gcc \
libc6-dev \
libglu1 \
libglu1:i386 \
libsm6 \
libxv1 \
libxv1:i386 \
make \
python \
python-numpy \
x11-xkb-utils \
xauth \
xfonts-base \
xkb-data && \
rm -rf /var/lib/apt/lists/*
RUN cd /tmp && \
curl -fsSL -O https://svwh.dl.sourceforge.net/project/turbovnc/${TURBOVNC_VERSION}/turbovnc_${TURBOVNC_VERSION}_amd64.deb \
-O https://svwh.dl.sourceforge.net/project/libjpeg-turbo/${LIBJPEG_VERSION}/libjpeg-turbo-official_${LIBJPEG_VERSION}_amd64.deb \
-O https://svwh.dl.sourceforge.net/project/virtualgl/${VIRTUALGL_VERSION}/virtualgl_${VIRTUALGL_VERSION}_amd64.deb \
-O https://svwh.dl.sourceforge.net/project/virtualgl/${VIRTUALGL_VERSION}/virtualgl32_${VIRTUALGL_VERSION}_amd64.deb && \
dpkg -i *.deb && \
rm -f /tmp/*.deb && \
sed -i 's/$host:/unix:/g' /opt/TurboVNC/bin/vncserver
ENV PATH ${PATH}:/opt/VirtualGL/bin:/opt/TurboVNC/bin
RUN curl -fsSL https://github.com/novnc/noVNC/archive/v${NOVNC_VERSION}.tar.gz | tar -xzf - -C /opt && \
curl -fsSL https://github.com/novnc/websockify/archive/v${WEBSOCKIFY_VERSION}.tar.gz | tar -xzf - -C /opt && \
mv /opt/noVNC-${NOVNC_VERSION} /opt/noVNC && \
mv /opt/websockify-${WEBSOCKIFY_VERSION} /opt/websockify && \
ln -s /opt/noVNC/vnc_lite.html /opt/noVNC/index.html && \
cd /opt/websockify && make
ADD self.pem /
RUN echo 'no-remote-connections\n\
no-httpd\n\
no-x11-tcp-connections\n\
no-pam-sessions\n\
permitted-security-types = otp\
' > /etc/turbovncserver-security.conf
# Install Java 8
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential libgtk2.0-dev \
libgtk2.0-0:i386 libsm6:i386 \
software-properties-common python-software-properties \
default-jre default-jdk
# Install Java.
RUN \
echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \
add-apt-repository -y ppa:webupd8team/java && \
apt-get update && \
apt-get install -y oracle-java8-installer && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /var/cache/oracle-jdk8-installer
# Set the locale
RUN apt-get clean && apt-get update && apt-get install -y locales
RUN locale-gen en_US.UTF-8
# some utils to have proper menus, mime file types etc.
#RUN apt-get install -y --no-install-recommends xdg-utils xdg-user-dirs \
# menu-xdg mime-support desktop-file-utils
# Xfce
RUN apt-get install -y --no-install-recommends xfce4
RUN apt-get install -y --no-install-recommends gtk3-engines-xfce xfce4-notifyd \
mousepad xfce4-taskmanager xfce4-terminal libgtk-3-bin
# Define working directory.
WORKDIR /data
# Define commonly used JAVA_HOME variable
ENV JAVA_HOME /usr/lib/jvm/java-8-oracle
# Define default command.
CMD ["bash"]
EXPOSE 5901
ENV DISPLAY :1
ENTRYPOINT ["/opt/websockify/run", "5901", "--cert=/self.pem", "--ssl-only", "--web=/opt/noVNC", "--wrap-mode=ignore", "--", "vncserver", "-geometry", "1920x1080", "-dpi", "128"]
#":1", "-securitytypes", "otp", "-otp", "-noxstartup"]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment