Azeez98 commited on
Commit
8b9ac1c
·
verified ·
1 Parent(s): 77c52d8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -16
Dockerfile CHANGED
@@ -1,16 +1,15 @@
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 && \
@@ -20,19 +19,14 @@ RUN useradd -m -s /bin/bash kaliuser && \
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"]
 
1
+ # Use the official Kali Linux base image
2
  FROM kalilinux/kali-rolling
3
 
4
+ # Switch to root temporarily for package installation
5
  USER root
6
 
7
  # Update and install necessary packages
8
  RUN apt update && apt install -y \
9
+ xfce4 xfce4-terminal tightvncserver websockify curl wget net-tools \
 
10
  && apt clean
11
 
12
+ # Create a non-root user (since root access isn't available during runtime)
13
  RUN useradd -m -s /bin/bash kaliuser && \
14
  echo "kaliuser:kaliuser" | chpasswd && \
15
  mkdir -p /home/kaliuser/.vnc && \
 
19
  chmod +x /home/kaliuser/.vnc/xstartup && \
20
  chown -R kaliuser:kaliuser /home/kaliuser
21
 
22
+ # Switch to the non-root user
23
+ USER kaliuser
24
  ENV USER=kaliuser
25
  ENV HOME=/home/kaliuser
26
  WORKDIR /home/kaliuser
27
 
28
+ # Expose a custom web server (VNC proxy)
29
+ EXPOSE 7860
 
 
 
 
 
 
30
 
31
+ # Start tightvncserver and serve via websockify
32
+ CMD ["bash", "-c", "tightvncserver :1 && websockify --web=/usr/share/novnc 7860 localhost:5901"]