mirror of
https://github.com/linuxserver/docker-baseimage-kasmvnc.git
synced 2026-02-20 08:28:57 +08:00
adding DRI3 gpu support to alpine baseimage
This commit is contained in:
parent
1281dc5f47
commit
cff2bf12ae
67
Dockerfile
67
Dockerfile
@ -28,24 +28,29 @@ RUN \
|
||||
|
||||
FROM ghcr.io/linuxserver/baseimage-alpine:3.17 as buildstage
|
||||
|
||||
ARG KASMVNC_RELEASE="1.0.1"
|
||||
ARG KASMVNC_RELEASE="master"
|
||||
|
||||
COPY --from=wwwstage /build-out /www
|
||||
|
||||
RUN \
|
||||
echo "**** install build deps ****" && \
|
||||
apk add \
|
||||
alpine-release \
|
||||
alpine-sdk \
|
||||
autoconf \
|
||||
automake \
|
||||
bash \
|
||||
ca-certificates \
|
||||
cmake \
|
||||
xorg-server-dev \
|
||||
coreutils \
|
||||
curl \
|
||||
eudev-dev \
|
||||
font-cursor-misc \
|
||||
font-misc-misc \
|
||||
font-util-dev \
|
||||
git \
|
||||
grep \
|
||||
jq \
|
||||
libdrm-dev \
|
||||
libepoxy-dev \
|
||||
libjpeg-turbo-dev \
|
||||
@ -71,7 +76,10 @@ RUN \
|
||||
nettle-dev \
|
||||
openssl-dev \
|
||||
pixman-dev \
|
||||
procps \
|
||||
shadow \
|
||||
tar \
|
||||
tzdata \
|
||||
wayland-dev \
|
||||
wayland-protocols \
|
||||
xcb-util-dev \
|
||||
@ -85,13 +93,14 @@ RUN \
|
||||
xkeyboard-config \
|
||||
xorgproto \
|
||||
xorg-server-common \
|
||||
xorg-server-dev \
|
||||
xtrans
|
||||
|
||||
RUN \
|
||||
echo "**** build kasmvnc ****" && \
|
||||
git clone https://github.com/kasmtech/KasmVNC.git src && \
|
||||
cd /src && \
|
||||
git checkout -f release/${KASMVNC_release} && \
|
||||
git checkout -f ${KASMVNC_release} && \
|
||||
sed -i \
|
||||
-e '/find_package(FLTK/s@^@#@' \
|
||||
-e '/add_subdirectory(tests/s@^@#@' \
|
||||
@ -103,40 +112,42 @@ RUN \
|
||||
. && \
|
||||
make -j4 && \
|
||||
echo "**** build xorg ****" && \
|
||||
XORG_VER="1.20.7" && \
|
||||
XORG_VER="1.20.14" && \
|
||||
XORG_PATCH=$(echo "$XORG_VER" | grep -Po '^\d.\d+' | sed 's#\.##') && \
|
||||
wget --no-check-certificate \
|
||||
-O /tmp/xorg-server-${XORG_VER}.tar.bz2 \
|
||||
"https://www.x.org/archive/individual/xserver/xorg-server-${XORG_VER}.tar.bz2" && \
|
||||
-O /tmp/xorg-server-${XORG_VER}.tar.gz \
|
||||
"https://www.x.org/archive/individual/xserver/xorg-server-${XORG_VER}.tar.gz" && \
|
||||
tar --strip-components=1 \
|
||||
-C unix/xserver \
|
||||
-xf /tmp/xorg-server-${XORG_VER}.tar.bz2 && \
|
||||
-xf /tmp/xorg-server-${XORG_VER}.tar.gz && \
|
||||
cd unix/xserver && \
|
||||
patch -Np1 -i ../xserver${XORG_PATCH}.patch && \
|
||||
patch -s -p0 < ../CVE-2022-2320-v1.20.patch && \
|
||||
autoreconf -i && \
|
||||
./configure --prefix=/opt/kasmweb \
|
||||
--with-xkb-path=/usr/share/X11/xkb \
|
||||
--with-xkb-output=/var/lib/xkb \
|
||||
--with-xkb-bin-directory=/usr/bin \
|
||||
--with-default-font-path="/usr/share/fonts/X11/misc,/usr/share/fonts/X11/cyrillic,/usr/share/fonts/X11/100dpi/:unscaled,/usr/share/fonts/X11/75dpi/:unscaled,/usr/share/fonts/X11/Type1,/usr/share/fonts/X11/100dpi,/usr/share/fonts/X11/75dpi,built-ins" \
|
||||
--with-sha1=libcrypto \
|
||||
--without-dtrace --disable-dri \
|
||||
--disable-static \
|
||||
--disable-xinerama \
|
||||
--disable-xvfb \
|
||||
--disable-xnest \
|
||||
--disable-xorg \
|
||||
--disable-dmx \
|
||||
--disable-xwin \
|
||||
--disable-xephyr \
|
||||
--disable-kdrive \
|
||||
./configure \
|
||||
--disable-config-hal \
|
||||
--disable-config-udev \
|
||||
--disable-dmx \
|
||||
--disable-dri \
|
||||
--disable-dri2 \
|
||||
--enable-glx \
|
||||
--disable-kdrive \
|
||||
--disable-static \
|
||||
--disable-xephyr \
|
||||
--disable-xinerama \
|
||||
--disable-xnest \
|
||||
--disable-xorg \
|
||||
--disable-xvfb \
|
||||
--disable-xwayland \
|
||||
--disable-dri3 && \
|
||||
--disable-xwin \
|
||||
--enable-dri3 \
|
||||
--enable-glx \
|
||||
--prefix=/opt/kasmweb \
|
||||
--with-default-font-path="/usr/share/fonts/X11/misc,/usr/share/fonts/X11/cyrillic,/usr/share/fonts/X11/100dpi/:unscaled,/usr/share/fonts/X11/75dpi/:unscaled,/usr/share/fonts/X11/Type1,/usr/share/fonts/X11/100dpi,/usr/share/fonts/X11/75dpi,built-ins" \
|
||||
--without-dtrace \
|
||||
--with-sha1=libcrypto \
|
||||
--with-xkb-bin-directory=/usr/bin \
|
||||
--with-xkb-output=/var/lib/xkb \
|
||||
--with-xkb-path=/usr/share/X11/xkb && \
|
||||
find . -name "Makefile" -exec sed -i 's/-Werror=array-bounds//g' {} \; && \
|
||||
make -j4
|
||||
|
||||
@ -183,7 +194,7 @@ RUN \
|
||||
RUN \
|
||||
echo "**** grab source ****" && \
|
||||
mkdir -p /kclient && \
|
||||
if [ -z ${GCLIENT_RELEASE+x} ]; then \
|
||||
if [ -z ${KCLIENT_RELEASE+x} ]; then \
|
||||
KCLIENT_RELEASE=$(curl -sX GET "https://api.github.com/repos/linuxserver/kclient/releases/latest" \
|
||||
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
|
||||
fi && \
|
||||
@ -237,9 +248,11 @@ RUN \
|
||||
libstdc++ \
|
||||
libwebp \
|
||||
libxfont2 \
|
||||
libxshmfence \
|
||||
mcookie \
|
||||
mesa \
|
||||
mesa-dri-gallium \
|
||||
mesa-gbm \
|
||||
mesa-gl \
|
||||
nginx \
|
||||
nodejs \
|
||||
@ -265,6 +278,8 @@ RUN \
|
||||
xf86-video-amdgpu \
|
||||
xf86-video-ati \
|
||||
xf86-video-intel \
|
||||
xf86-video-nouveau \
|
||||
xf86-video-qxl \
|
||||
xkbcomp \
|
||||
xkeyboard-config \
|
||||
xterm && \
|
||||
|
||||
@ -33,24 +33,29 @@ RUN \
|
||||
|
||||
FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.17 as buildstage
|
||||
|
||||
ARG KASMVNC_RELEASE="1.0.1"
|
||||
ARG KASMVNC_RELEASE="master"
|
||||
|
||||
COPY --from=wwwstage /build-out /www
|
||||
|
||||
RUN \
|
||||
echo "**** install build deps ****" && \
|
||||
apk add \
|
||||
alpine-release \
|
||||
alpine-sdk \
|
||||
autoconf \
|
||||
automake \
|
||||
bash \
|
||||
ca-certificates \
|
||||
cmake \
|
||||
xorg-server-dev \
|
||||
coreutils \
|
||||
curl \
|
||||
eudev-dev \
|
||||
font-cursor-misc \
|
||||
font-misc-misc \
|
||||
font-util-dev \
|
||||
git \
|
||||
grep \
|
||||
jq \
|
||||
libdrm-dev \
|
||||
libepoxy-dev \
|
||||
libjpeg-turbo-dev \
|
||||
@ -76,7 +81,10 @@ RUN \
|
||||
nettle-dev \
|
||||
openssl-dev \
|
||||
pixman-dev \
|
||||
procps \
|
||||
shadow \
|
||||
tar \
|
||||
tzdata \
|
||||
wayland-dev \
|
||||
wayland-protocols \
|
||||
xcb-util-dev \
|
||||
@ -90,13 +98,14 @@ RUN \
|
||||
xkeyboard-config \
|
||||
xorgproto \
|
||||
xorg-server-common \
|
||||
xorg-server-dev \
|
||||
xtrans
|
||||
|
||||
RUN \
|
||||
echo "**** build kasmvnc ****" && \
|
||||
git clone https://github.com/kasmtech/KasmVNC.git src && \
|
||||
cd /src && \
|
||||
git checkout -f release/${KASMVNC_release} && \
|
||||
git checkout -f ${KASMVNC_release} && \
|
||||
sed -i \
|
||||
-e '/find_package(FLTK/s@^@#@' \
|
||||
-e '/add_subdirectory(tests/s@^@#@' \
|
||||
@ -108,40 +117,42 @@ RUN \
|
||||
. && \
|
||||
make -j4 && \
|
||||
echo "**** build xorg ****" && \
|
||||
XORG_VER="1.20.7" && \
|
||||
XORG_VER="1.20.14" && \
|
||||
XORG_PATCH=$(echo "$XORG_VER" | grep -Po '^\d.\d+' | sed 's#\.##') && \
|
||||
wget --no-check-certificate \
|
||||
-O /tmp/xorg-server-${XORG_VER}.tar.bz2 \
|
||||
"https://www.x.org/archive/individual/xserver/xorg-server-${XORG_VER}.tar.bz2" && \
|
||||
-O /tmp/xorg-server-${XORG_VER}.tar.gz \
|
||||
"https://www.x.org/archive/individual/xserver/xorg-server-${XORG_VER}.tar.gz" && \
|
||||
tar --strip-components=1 \
|
||||
-C unix/xserver \
|
||||
-xf /tmp/xorg-server-${XORG_VER}.tar.bz2 && \
|
||||
-xf /tmp/xorg-server-${XORG_VER}.tar.gz && \
|
||||
cd unix/xserver && \
|
||||
patch -Np1 -i ../xserver${XORG_PATCH}.patch && \
|
||||
patch -s -p0 < ../CVE-2022-2320-v1.20.patch && \
|
||||
autoreconf -i && \
|
||||
./configure --prefix=/opt/kasmweb \
|
||||
--with-xkb-path=/usr/share/X11/xkb \
|
||||
--with-xkb-output=/var/lib/xkb \
|
||||
--with-xkb-bin-directory=/usr/bin \
|
||||
--with-default-font-path="/usr/share/fonts/X11/misc,/usr/share/fonts/X11/cyrillic,/usr/share/fonts/X11/100dpi/:unscaled,/usr/share/fonts/X11/75dpi/:unscaled,/usr/share/fonts/X11/Type1,/usr/share/fonts/X11/100dpi,/usr/share/fonts/X11/75dpi,built-ins" \
|
||||
--with-sha1=libcrypto \
|
||||
--without-dtrace --disable-dri \
|
||||
--disable-static \
|
||||
--disable-xinerama \
|
||||
--disable-xvfb \
|
||||
--disable-xnest \
|
||||
--disable-xorg \
|
||||
--disable-dmx \
|
||||
--disable-xwin \
|
||||
--disable-xephyr \
|
||||
--disable-kdrive \
|
||||
./configure \
|
||||
--disable-config-hal \
|
||||
--disable-config-udev \
|
||||
--disable-dmx \
|
||||
--disable-dri \
|
||||
--disable-dri2 \
|
||||
--enable-glx \
|
||||
--disable-kdrive \
|
||||
--disable-static \
|
||||
--disable-xephyr \
|
||||
--disable-xinerama \
|
||||
--disable-xnest \
|
||||
--disable-xorg \
|
||||
--disable-xvfb \
|
||||
--disable-xwayland \
|
||||
--disable-dri3 && \
|
||||
--disable-xwin \
|
||||
--enable-dri3 \
|
||||
--enable-glx \
|
||||
--prefix=/opt/kasmweb \
|
||||
--with-default-font-path="/usr/share/fonts/X11/misc,/usr/share/fonts/X11/cyrillic,/usr/share/fonts/X11/100dpi/:unscaled,/usr/share/fonts/X11/75dpi/:unscaled,/usr/share/fonts/X11/Type1,/usr/share/fonts/X11/100dpi,/usr/share/fonts/X11/75dpi,built-ins" \
|
||||
--without-dtrace \
|
||||
--with-sha1=libcrypto \
|
||||
--with-xkb-bin-directory=/usr/bin \
|
||||
--with-xkb-output=/var/lib/xkb \
|
||||
--with-xkb-path=/usr/share/X11/xkb && \
|
||||
find . -name "Makefile" -exec sed -i 's/-Werror=array-bounds//g' {} \; && \
|
||||
make -j4
|
||||
|
||||
@ -188,7 +199,7 @@ RUN \
|
||||
RUN \
|
||||
echo "**** grab source ****" && \
|
||||
mkdir -p /kclient && \
|
||||
if [ -z ${GCLIENT_RELEASE+x} ]; then \
|
||||
if [ -z ${KCLIENT_RELEASE+x} ]; then \
|
||||
KCLIENT_RELEASE=$(curl -sX GET "https://api.github.com/repos/linuxserver/kclient/releases/latest" \
|
||||
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
|
||||
fi && \
|
||||
@ -242,9 +253,11 @@ RUN \
|
||||
libstdc++ \
|
||||
libwebp \
|
||||
libxfont2 \
|
||||
libxshmfence \
|
||||
mcookie \
|
||||
mesa \
|
||||
mesa-dri-gallium \
|
||||
mesa-gbm \
|
||||
mesa-gl \
|
||||
nginx \
|
||||
nodejs \
|
||||
@ -269,6 +282,7 @@ RUN \
|
||||
xauth \
|
||||
xf86-video-amdgpu \
|
||||
xf86-video-ati \
|
||||
xf86-video-nouveau \
|
||||
xkbcomp \
|
||||
xkeyboard-config \
|
||||
xterm && \
|
||||
|
||||
@ -1,7 +1,17 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
# Pass gpu flags if mounted
|
||||
if [ -e /dev/dri/renderD* ]; then
|
||||
HW3D="-hw3d"
|
||||
fi
|
||||
if [ -z ${DRINODE+x} ]; then
|
||||
DRINODE="/dev/dri/renderD128"
|
||||
fi
|
||||
|
||||
s6-setuidgid abc \
|
||||
/usr/local/bin/Xvnc $DISPLAY \
|
||||
${HW3D} \
|
||||
-drinode ${DRINODE} \
|
||||
-disableBasicAuth \
|
||||
-SecurityTypes None \
|
||||
-AlwaysShared \
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user