-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
39 lines (33 loc) · 1.05 KB
/
Dockerfile
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
FROM debian:bullseye-slim
LABEL author="Jakob / SIMULATAN <simulatan2319@gmail.com>"
# first create user and group for all the X Window stuff
# required to do this first so have consistent uid/gid between server and client container
RUN addgroup --system xusers \
&& adduser \
--home /home/xuser \
--disabled-password \
--shell /bin/bash \
--gecos "user for running X Window stuff" \
--ingroup xusers \
--quiet \
xuser
# Install xvfb as X-Server and x11vnc as VNC-Server
RUN apt-get update && apt-get install -y --no-install-recommends \
xvfb \
xauth \
x11vnc \
x11-utils \
x11-xserver-utils \
&& rm -rf /var/lib/apt/lists/*
# create or use the volume depending on how container is run
# ensure that server and client can access the cookie
RUN mkdir -p /Xauthority && chown -R xuser:xusers /Xauthority
VOLUME /Xauthority
# start x11vnc and expose its port
ENV DISPLAY :0.0
EXPOSE 5900
COPY docker-entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# switch to user and start
USER xuser
ENTRYPOINT [ "/entrypoint.sh" ]