Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +22 -11
Dockerfile
CHANGED
@@ -1,27 +1,38 @@
|
|
1 |
# Use the official Kali Linux image
|
2 |
FROM kalilinux/kali-rolling
|
3 |
|
|
|
|
|
|
|
4 |
# Update and install necessary packages
|
5 |
RUN apt update && apt install -y \
|
6 |
xfce4 xfce4-terminal tightvncserver novnc \
|
7 |
websockify curl wget net-tools \
|
8 |
&& apt clean
|
9 |
|
10 |
-
#
|
11 |
-
RUN
|
12 |
-
echo "
|
13 |
-
|
14 |
-
echo "
|
15 |
-
chmod
|
|
|
|
|
|
|
16 |
|
17 |
-
# Set
|
18 |
-
ENV USER=
|
|
|
|
|
19 |
|
20 |
-
# Fix permissions for noVNC
|
21 |
RUN chmod +x /usr/share/novnc/utils/launch.sh
|
22 |
|
23 |
-
#
|
|
|
|
|
|
|
24 |
EXPOSE 8080
|
25 |
|
26 |
-
# Start noVNC server on container start
|
27 |
CMD ["bash", "-c", "/usr/share/novnc/utils/launch.sh --vnc localhost:5901 --listen 8080 & tightvncserver :1 && tail -f /dev/null"]
|
|
|
1 |
# Use the official Kali Linux image
|
2 |
FROM kalilinux/kali-rolling
|
3 |
|
4 |
+
# Switch to root temporarily to install necessary packages
|
5 |
+
USER root
|
6 |
+
|
7 |
# Update and install necessary packages
|
8 |
RUN apt update && apt install -y \
|
9 |
xfce4 xfce4-terminal tightvncserver novnc \
|
10 |
websockify curl wget net-tools \
|
11 |
&& apt clean
|
12 |
|
13 |
+
# Create a non-root user
|
14 |
+
RUN useradd -m -s /bin/bash kaliuser && \
|
15 |
+
echo "kaliuser:kaliuser" | chpasswd && \
|
16 |
+
mkdir -p /home/kaliuser/.vnc && \
|
17 |
+
echo "password" | vncpasswd -f > /home/kaliuser/.vnc/passwd && \
|
18 |
+
chmod 600 /home/kaliuser/.vnc/passwd && \
|
19 |
+
echo "exec startxfce4" > /home/kaliuser/.vnc/xstartup && \
|
20 |
+
chmod +x /home/kaliuser/.vnc/xstartup && \
|
21 |
+
chown -R kaliuser:kaliuser /home/kaliuser
|
22 |
|
23 |
+
# Set the environment for the new user
|
24 |
+
ENV USER=kaliuser
|
25 |
+
ENV HOME=/home/kaliuser
|
26 |
+
WORKDIR /home/kaliuser
|
27 |
|
28 |
+
# Fix permissions for noVNC
|
29 |
RUN chmod +x /usr/share/novnc/utils/launch.sh
|
30 |
|
31 |
+
# Switch to the non-root user
|
32 |
+
USER kaliuser
|
33 |
+
|
34 |
+
# Expose the noVNC port
|
35 |
EXPOSE 8080
|
36 |
|
37 |
+
# Start noVNC and VNC server on container start
|
38 |
CMD ["bash", "-c", "/usr/share/novnc/utils/launch.sh --vnc localhost:5901 --listen 8080 & tightvncserver :1 && tail -f /dev/null"]
|