-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathDockerfile
More file actions
220 lines (196 loc) · 7.06 KB
/
Copy pathDockerfile
File metadata and controls
220 lines (196 loc) · 7.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
# x11docker/xserver
#
# Internal use of x11docker to run X servers in container
# Used automatically by x11docker if image is available locally.
# Can be configured with option --xc.
#
# Build image with: x11docker --build x11docker/xserver
# The build will take a while because nxagent is compiled from source.
#
# x11docker on github: https://github.com/mviereck/x11docker
FROM debian:trixie AS buildstage
#########################
RUN echo "deb-src http://deb.debian.org/debian trixie main" >> /etc/apt/sources.list && \
apt-get update && \
apt-get install -y \
build-essential \
gcc \
devscripts
# build patched nxagent from source. Allows to run with /tmp/.X11-unix not to be owned by root.
# https://github.com/ArcticaProject/nx-libs/issues/1034
RUN apt-get build-dep -y nxagent && \
mkdir /nxbuild && \
cd /nxbuild && \
apt-get source nxagent && \
cd nx-libs-3.5.99.27 && \
sed -i 's/# define XtransFailSoft NO/# define XtransFailSoft YES/' nx-X11/config/cf/X11.rules && \
debuild -b -uc -us
# build xwayland-satellite
RUN apt-get install -y \
clang \
cargo \
libxcb-cursor-dev \
git && \
cd / && \
git clone https://github.com/Supreeeme/xwayland-satellite.git && \
cd xwayland-satellite && \
cargo build --release
# build fake MIT-SHM library
COPY XlibNoSHM.c /XlibNoSHM.c
RUN env DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
libc6-dev \
libx11-dev && \
gcc -shared -o /XlibNoSHM.so /XlibNoSHM.c
# build bindkey for --clipboard=superaltv
COPY bindkey.c /bindkey.c
RUN env DEBIAN_FRONTEND=noninteractive apt-get install -y \
libevdev-dev \
libinput-dev && \
gcc -I/usr/include/libevdev-1.0 -I/usr/include/libevdev-1.0/libevdev -o /bindkey /bindkey.c -levdev
#########################
FROM debian:trixie
ENV DIST=trixie
COPY --from=buildstage /nxbuild/nxagent_3.*.deb /nxagent.deb
COPY --from=buildstage /xwayland-satellite/target/release/xwayland-satellite /usr/bin/xwayland-satellite
COPY --from=buildstage /XlibNoSHM.so /XlibNoSHM.so
COPY --from=buildstage /bindkey /usr/local/bin/bindkey
# cleanup script for use after apt-get
RUN echo '#! /bin/sh\n\
env DEBIAN_FRONTEND=noninteractive apt-get autoremove --purge -y\n\
apt-get clean\n\
find /var/lib/apt/lists -type f -delete\n\
find /var/cache -type f -delete\n\
find /var/log -type f -delete\n\
exit 0\n\
' > /apt_cleanup && chmod +x /apt_cleanup
# install nxagent
RUN apt-get update && \
env DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
/nxagent.deb && \
/apt_cleanup
# X servers
RUN apt-get update && \
env DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
weston \
xserver-xephyr \
xserver-xorg \
xserver-xorg-legacy \
xvfb \
xwayland && \
apt-get install -y \
libdecor-0-0 \
libdecor-0-plugin-1-cairo \
libxcb1 \
libxcb-cursor0 && \
/apt_cleanup
# MESA
RUN apt-get update && \
env DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
libglx-mesa0 \
mesa-utils \
mesa-va-drivers \
mesa-vdpau-drivers \
mesa-vulkan-drivers && \
/apt_cleanup
# xpra from xpra repository
#RUN curl https://xpra.org/get-xpra.sh | bash && \
# /apt_cleanup
RUN apt-get update && \
env DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
apt-transport-https \
ca-certificates \
wget && \
wget -O "/usr/share/keyrings/xpra.asc" https://xpra.org/xpra.asc && \
wget -O "/etc/apt/sources.list.d/xpra.sources" https://raw.githubusercontent.com/Xpra-org/xpra/master/packaging/repos/$DIST/xpra.sources && \
apt-get update && \
env DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
xpra \
xpra-audio \
xpra-audio-server \
xpra-codecs-extras \
xpra-codecs-nvidia \
xpra-x11 \
ibus \
python3-rencode && \
apt-get remove --purge -y \
wget \
ca-certificates && \
/apt_cleanup
# Window manager openbox with disabled context menu
RUN apt-get update && \
env DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
openbox && \
sed -i /ShowMenu/d /etc/xdg/openbox/rc.xml && \
sed -i s/NLIMC/NLMC/ /etc/xdg/openbox/rc.xml && \
/apt_cleanup
# tools
RUN apt-get update && \
env DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
catatonit \
procps \
psmisc \
psutils \
socat \
vainfo \
vdpauinfo \
virgl-server \
wl-clipboard \
wmctrl \
x11-apps \
x11-utils \
x11-xkb-utils \
x11-xserver-utils \
xauth \
xbindkeys \
xclip \
xdotool \
xinit \
xcvt && \
/apt_cleanup
# xfishtank
RUN apt-get update && \
env DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
wget && \
wget http://ftp.debian.org/debian/pool/main/x/xfishtank/xfishtank_3.2.2-1_amd64.deb && \
apt-get install -y ./xfishtank_3.2.2-1_amd64.deb && \
rm ./xfishtank_3.2.2-1_amd64.deb && \
apt-get remove -y wget && \
/apt_cleanup
# configure Xorg wrapper
RUN echo 'allowed_users=anybody' >/etc/X11/Xwrapper.config && \
echo 'needs_root_rights=yes' >>/etc/X11/Xwrapper.config
# wrapper to run weston either on console or within DISPLAY or WAYLAND_DISPLAY
# note: includes setuid for agetty to allow it for unprivileged users
#RUN echo '#! /bin/bash \n\
#case "$DISPLAY$WAYLAND_DISPLAY" in \n\
# "") \n\
# [ -e /dev/tty$XDG_VTNR ] && [ -n "$XDG_VTNR" ] || { \n\
# echo "ERROR: No display and no tty found. XDG_VTNR is empty." >&2 \n\
# exit 1 \n\
# } \n\
# /usr/bin/weston $@ \n\
# #exec agetty --login-options "-v -- $* --log=/x11docker/compositor.log " --autologin $(id -un) --login-program /usr/bin/weston-launch --noclear tty$XDG_VTNR \n\
# ;; \n\
# *) \n\
# exec /usr/bin/weston "$@" \n\
# ;; \n\
#esac \n\
#' >/usr/local/bin/weston && \
# chmod +x /usr/local/bin/weston && \
# ln /usr/local/bin/weston /usr/local/bin/weston-launch
RUN chown root:input /usr/local/bin/bindkey && \
chmod +g /usr/local/bin/bindkey
# HOME
RUN mkdir -p /home/container && chmod 777 /home/container
ENV HOME=/home/container
LABEL version='2.6'
LABEL options='--nxagent --weston --weston-xwayland --xephyr --xpra --xpra-xwayland --xpra2 --xpra2-xwayland --xorg --xvfb --xwayland --satellite'
LABEL tools='bindkey catatonit cvt glxinfo iceauth setxkbmap socat \
vainfo vdpauinfo virgl wl-copy wl-paste wmctrl \
xauth xbindkeys xclip xdotool xdpyinfo xdriinfo xev \
xeyes xlogo xfishtank xhost xinit xkbcomp xkill xlsclients xmessage \
xmodmap xprop xrandr xrefresh xset xsetroot xvinfo xwininfo'
LABEL options_console='--weston --weston-xwayland --xorg'
LABEL gpu='MESA'
LABEL windowmanager='openbox'
ENTRYPOINT ["/usr/bin/catatonit", "--"]