-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
sam#gemmi-win10
committed
Oct 14, 2023
1 parent
79e648a
commit a7a2fab
Showing
1 changed file
with
141 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
FROM infrastlabs/docker-headless:deb12-compile as stage-base | ||
|
||
###xrdp, xorgxrdp############################################### | ||
FROM stage-base as stage-xrdp | ||
#0.9.5 > 0.9.16 > 0.9.19(thunar@gemmi-deb11卡死) | ||
ENV ver="0.9.16" | ||
# https://hub.fastgit.org/neutrinolabs/xrdp/wiki/Building-on-Debian-8 | ||
# configure: error: please install libfdk-aac-dev or fdk-aac-devel | ||
# --enable-tjpeg \ | ||
# ./configure --prefix=/usr/local/xrdp --enable-fuse --enable-mp3lame --enable-pixman;\ | ||
ADD src/arm /src/arm | ||
# RUN wget https://github.com/neutrinolabs/xrdp/releases/download/v${ver}/xrdp-${ver}.tar.gz; \ | ||
RUN \ | ||
tar -zxf /src/arm/xrdp-${ver}.tar.gz;\ | ||
cd xrdp-${ver};\ | ||
./bootstrap;\ | ||
./configure \ | ||
--prefix=/usr/local/xrdp \ | ||
--enable-vsock \ | ||
--enable-fdkaac \ | ||
--enable-opus \ | ||
--enable-fuse \ | ||
--enable-mp3lame \ | ||
--enable-pixman \ | ||
CFLAGS='-Wno-format';\ | ||
make;\ | ||
make install; | ||
|
||
#####git clone; xorgxrdp with xrdp --prefix, testOK; | ||
# # gitee.com/g-system/xorgxrdp | ||
# RUN git clone --branch br-0214 https://gitee.com/g-system/xorgxrdp;\ | ||
# cd xorgxrdp;\ | ||
# ./bootstrap;\ | ||
# CPPFLAGS="-I/usr/local/xrdp/include" LDFLAGS="-L/usr/local/xrdp/lib" ./configure;\ | ||
# make;\ | ||
# sudo make install; | ||
|
||
###pulseaudio-module-xrdp############################################### | ||
# pulse-xrdp: git-latest | ||
FROM stage-base as stage-pulsexrdp | ||
#### pulseaudio-module-xrdp >> pulseaudio ver: 10.0 | ||
# RUN git submodule update --init --recursive | ||
RUN apt update && apt build-dep -q -y pulseaudio && \ | ||
cd /opt && apt source pulseaudio && \ | ||
pulseaudio=$(pulseaudio --version | awk '{print $2}') && \ | ||
cd /opt/pulseaudio-${pulseaudio} && ./configure | ||
# RUN pulseaudio=$(pulseaudio --version); echo "pulseaudio: $pulseaudio" | ||
# hand copy: /opt/pulseaudio-1.11/config.h +src/pulsecore | ||
# https://github.com/neutrinolabs/pulseaudio-module-xrdp.git | ||
# https://gitee.com/g-system/pulseaudio-module-xrdp.git | ||
RUN cd /opt && git clone --branch v0.5 https://gitee.com/g-system/pulseaudio-module-xrdp.git && \ | ||
cd /opt/pulseaudio-module-xrdp ;\ | ||
pulseaudio=$(pulseaudio --version | awk '{print $2}') && echo "pulseaudio ver: $pulseaudio" && \ | ||
./bootstrap && ./configure PULSE_DIR="/opt/pulseaudio-${pulseaudio}"; \ | ||
cp -a /opt/pulseaudio-${pulseaudio}/config.h . && cp -a /opt/pulseaudio-${pulseaudio}/src/pulsecore/ .; \ | ||
make && \ | ||
cd /opt/pulseaudio-module-xrdp/src/.libs && \ | ||
install -t "/var/lib/xrdp-pulseaudio-installer" -D -m 644 *.so; | ||
|
||
|
||
###tigervnc############################################### | ||
# ref: https://github.com/abcdesktopio/tigervnc/blob/main/Dockerfile | ||
FROM stage-base as stage-tiger | ||
# deb12: Could NOT find X11 (missing: X11_X11_LIB) | ||
RUN apt.sh \ | ||
libx11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev | ||
# ins: dev, dep and sources | ||
RUN apt update; \ | ||
# 129 MB | ||
apt build-dep -y tigervnc | ||
# src | ||
ADD src/arm /src/arm | ||
WORKDIR /src/arm | ||
RUN mkdir -p /build; \ | ||
tar -zxf tigervnc-1.12.0.tar.gz -C /build/; \ | ||
tar -jxf xorg-server-1.20.7.tar.bz2 --strip-components=1 -C /build/tigervnc-1.12.0/unix/xserver/; \ | ||
\cp -a tigervnc-1.12.0-configuration_fixes-1.patch /build/; \ | ||
\ | ||
ls /build/tigervnc-1.12.0/unix/xserver/ | ||
|
||
# apply patch: tigervnc-1.12.0; xserver120 | ||
WORKDIR /build/tigervnc-1.12.0 | ||
|
||
#MAKE vncviewver, vncpasswd, vncconfig, ... | ||
# err with armv7: | ||
#0 16.95 CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message): | ||
#0 16.95 Could NOT find X11 (missing: X11_X11_LIB) | ||
RUN patch -Np1 -i ../tigervnc-1.12.0-configuration_fixes-1.patch; \ | ||
cd unix/xserver && patch -Np1 -i ../xserver120.patch; \ | ||
cd /build/tigervnc-1.12.0; \ | ||
cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DINSTALL_SYSTEMD_UNITS=OFF -Wno-dev . && make | ||
|
||
# MAKE SERVER | ||
WORKDIR /build/tigervnc-1.12.0/unix/xserver | ||
# --disable-static | ||
# --enable-xvfb > --disable-xvfb #不生成xvfb | ||
# --enable-glx ##libgl1? 24M (drop-all-enabled: 还是有依赖) | ||
RUN autoreconf -fiv; \ | ||
CPPFLAGS="-I/usr/include/drm" \ | ||
./configure $XORG_CONFIG \ | ||
--prefix=/usr/local/tigervnc \ | ||
--disable-xwayland --disable-dri --disable-dmx \ | ||
--disable-xorg --disable-xnest --disable-xvfb \ | ||
--disable-xwin --disable-xephyr --disable-kdrive \ | ||
--disable-devel-docs --disable-config-hal --disable-config-udev \ | ||
--disable-unit-tests --disable-selective-werror \ | ||
--enable-dri3 --enable-dri2 \ | ||
--with-pic \ | ||
--without-dtrace; \ | ||
make && make install; | ||
# vncpasswd | ||
RUN cp /build/tigervnc-1.12.0/unix/vncpasswd/vncpasswd /usr/local/tigervnc/bin/ | ||
# https://github.com/TigerVNC/tigervnc/issues/800 | ||
# LD_PRELOAD=/lib/aarch64-linux-gnu/libgcc_s.so.1 vncserver :2 -localhost no | ||
|
||
# swrast_dri.so # /usr/lib/dri/swrast_dri.so | ||
# ln -s /usr/lib/x86_64-linux-gnu/dri /usr/lib/dri | ||
|
||
|
||
|
||
###merge: xrdp, pulse, tigervnc############################################### | ||
# 11.9M | ||
# FROM scratch | ||
FROM debian:12-slim | ||
ARG TARGETPLATFORM | ||
RUN RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list.d/debian.sources; \ | ||
\ | ||
echo 'apt update -qq && apt install -yq --no-install-recommends $@ && apt clean && rm -rf /var/lib/apt/lists/*; ' > /usr/local/bin/apt.sh \ | ||
&& chmod +x /usr/local/bin/apt.sh | ||
WORKDIR /rootfs/usr/local/tigervnc/bin | ||
COPY --from=stage-xrdp /usr/local/xrdp /rootfs/usr/local/xrdp | ||
# COPY --from=stage-xrdp /usr/lib/xorg/modules /rootfs/usr/lib/xorg/modules | ||
COPY --from=stage-pulsexrdp /var/lib/xrdp-pulseaudio-installer /rootfs/var/lib/xrdp-pulseaudio-installer | ||
COPY --from=stage-tiger /usr/local/tigervnc /rootfs/usr/local/tigervnc | ||
# test | ||
RUN apt.sh \ | ||
# --enable-xx ##还是需要libGL.so.1 | ||
libgl1 \ | ||
libunwind8 libpixman-1-0 libxfont2 libjpeg8 \ | ||
libxau6 libxdmcp6 | ||
RUN find /rootfs; /rootfs/usr/local/tigervnc/bin/Xvnc -version |