-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
75 lines (61 loc) · 2.5 KB
/
Dockerfile
File metadata and controls
75 lines (61 loc) · 2.5 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
FROM ubuntu:25.10 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
RUN apt update
# Install core utilities
RUN apt install -y --no-install-recommends sudo
RUN apt install -y --no-install-recommends wget
RUN apt install -y --no-install-recommends net-tools
RUN apt install -y --no-install-recommends dbus-x11
RUN apt install -y --no-install-recommends iputils-ping
RUN apt install -y --no-install-recommends netcat-traditional
RUN apt install -y --no-install-recommends procps
RUN apt install -y --no-install-recommends locales
RUN apt install -y --no-install-recommends curl
RUN apt install -y --no-install-recommends ca-certificates
RUN apt install -y --no-install-recommends firefox
# 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
RUN apt install -y --no-install-recommends xfce4
RUN apt install -y --no-install-recommends xfce4-terminal
RUN apt install -y --no-install-recommends xauth
RUN apt install -y --no-install-recommends hicolor-icon-theme
RUN apt install -y --no-install-recommends adwaita-icon-theme
RUN apt install -y --no-install-recommends gnome-icon-theme
RUN apt install -y --no-install-recommends tango-icon-theme
# Install VNC related packages
RUN apt install -y --no-install-recommends tightvncserver
RUN apt install -y --no-install-recommends novnc
RUN apt install -y --no-install-recommends websockify
RUN apt install -y --no-install-recommends systemd
RUN apt install -y --no-install-recommends snapd
# Set root password
RUN echo "root:root" | chpasswd
# 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
COPY self_destruct.sh /self_destruct.sh
RUN chmod +x /entrypoint.sh /self_destruct.sh
# Expose VNC and noVNC ports
EXPOSE 5901 6080
# Set user and working directory
USER sandbox
WORKDIR /home/sandbox
COPY ./.bashrc /home/sandbox/.bashrc
# Set the entrypoint script
ENTRYPOINT ["/entrypoint.sh"]