-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
73 lines (58 loc) · 1.69 KB
/
Copy pathDockerfile
File metadata and controls
73 lines (58 loc) · 1.69 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
FROM ubuntu:24.04 AS base
# Avoid interactive prompts during installation
ENV DEBIAN_FRONTEND=noninteractive
# Set locale properly to avoid perl warnings
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8
# Install core utilities
RUN apt update && apt install -y --no-install-recommends \
sudo \
wget \
dbus-x11 \
locales \
curl \
ca-certificates \
libxdo3
# Generate locales
RUN locale-gen en_US.UTF-8
# Install a simpler desktop environment that works better with VNC
RUN apt install -y --no-install-recommends \
xorg \
xfce4 \
xfce4-terminal \
xauth \
tightvncserver \
novnc \
websockify \
libwebkit2gtk-4.1-0 \
software-properties-common
# Install chromium and it's dependencies.
RUN add-apt-repository ppa:xtradeb/apps -y \
&& apt update \
&& apt install -y chromium\
&& rm -rf /var/lib/apt/lists/*
# Create a non-root user 'sandbox'
RUN useradd -m -s /bin/bash sandbox && \
echo "sandbox:password" | chpasswd && \
adduser sandbox sudo
# Set up VNC directory for the sandbox user
RUN mkdir -p /home/sandbox/.vnc
# Create an empty .Xauthority file
RUN touch /home/sandbox/.Xauthority
# Set ownership and permissions for VNC and Xauthority files
RUN chown -R sandbox:sandbox /home/sandbox/.vnc /home/sandbox/.Xauthority && \
chmod 0600 /home/sandbox/.Xauthority
# Copy startup and self-destruct scripts
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Install latest Vision.
RUN wget -O /tmp/package.deb https://v1.empr.cloud/get/linux-deb
RUN dpkg -i /tmp/package.deb || apt-get install -f -y
# Expose noVNC ports
EXPOSE 6080
EXPOSE 3030
# Set user and working directory
USER sandbox
WORKDIR /home/sandbox
# Set the entrypoint script
ENTRYPOINT ["/entrypoint.sh"]