-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
85 lines (63 loc) · 1.96 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
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
ARG OS=debian:bookworm-slim
# Multistage build
# Stage 1: Get novnc
FROM bitnami/git:latest as novnc
ARG NOVNC_VERSION=v1.5.0
WORKDIR /app
RUN git clone --depth 1 --branch ${NOVNC_VERSION} https://github.com/novnc/novnc
# Stage 2: Final image
FROM $OS
LABEL Name=base-gui Author=max06/base-gui Flavor=$OS
ARG PKG="apt-get install --no-install-recommends -y --ignore-missing"
ENV LANG en_US.UTF-8
ENV LC_ALL ${LANG}
ENV USER_ID=1000 GROUP_ID=1000
ENV APP=unknown
ENV PASSWORD=""
ENV UMASK=0022
ENV ALLOW_DIRECT_VNC=false
# Prepare installation
RUN apt-get -q update
RUN LC_ALL=C DEBIAN_FRONTEND=noninteractive ${PKG} lsb-release
# Install all the stuff
RUN LC_ALL=C DEBIAN_FRONTEND=noninteractive ${PKG} \
gosu \
locales \
openbox \
supervisor \
tigervnc-common \
$(lsb_release -sc | grep -q bookworm && echo tigervnc-tools) \
tigervnc-standalone-server \
tint2 \
python3-pip \
python3-venv \
nginx-light
# Cleanup
RUN apt-get clean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /var/cache/fontconfig/*
# novnc installation and patching
COPY --from=novnc /app/novnc/ /opt/novnc/
RUN sed -i "s/UI.initSetting('resize', 'off')/UI.initSetting('resize', 'remote')/g" /opt/novnc/app/ui.js
# install websockify
RUN python3 -m venv /opt/websockify
RUN /opt/websockify/bin/pip3 install websockify
# prepare nginx
COPY localfs/nginx/vnc.conf /etc/nginx/sites-enabled/vnc.conf
# Place our own configuration files
COPY localfs/supervisord.conf /etc/
COPY localfs/startup.sh /usr/local/bin/
COPY localfs/tint2rc /etc/xdg/tint2/
COPY localfs/openbox-autostart /etc/xdg/openbox/autostart
RUN chmod +x /usr/local/bin/startup.sh
# Add user to avoid root and create directories
RUN mkdir -p /app /data
# Set working dir
WORKDIR /app
# Web viewer
EXPOSE 4000
# Create locale (in subsequent build)
ONBUILD RUN sed -i "/${LANG}/s/^# //g" /etc/locale.gen && locale-gen
# And there we go!
ENTRYPOINT [ "/usr/local/bin/startup.sh" ]