Upload 4 files
Browse files- Dockerfile +45 -0
- deploy.yaml +24 -0
- startup.sh +14 -0
- xstartup +3 -0
Dockerfile
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM ubuntu:20.04
|
2 |
+
|
3 |
+
# Set environment variable to noninteractive
|
4 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
5 |
+
|
6 |
+
# Update package lists and install packages for xfce and other tools
|
7 |
+
RUN apt-get update && \
|
8 |
+
apt-get install -y tzdata && \
|
9 |
+
apt-get install -y xfce4 && \
|
10 |
+
apt-get install -y tightvncserver && \
|
11 |
+
apt-get install -y wget && \
|
12 |
+
apt-get install -y sudo && \
|
13 |
+
apt-get install -y git && \
|
14 |
+
apt-get install -y xfce4-terminal && \
|
15 |
+
apt-get clean
|
16 |
+
|
17 |
+
RUN apt-get install -y autocutsel
|
18 |
+
RUN apt-get install -y python3 python3-pip
|
19 |
+
RUN apt-get install firefox -y
|
20 |
+
RUN apt-get clean
|
21 |
+
|
22 |
+
# Setup VNC server
|
23 |
+
RUN mkdir -p /root/.vnc && \
|
24 |
+
echo "password" | vncpasswd -f > /root/.vnc/passwd && \
|
25 |
+
chmod 600 /root/.vnc/passwd
|
26 |
+
|
27 |
+
COPY xstartup /root/.vnc/xstartup
|
28 |
+
RUN chmod +x /root/.vnc/xstartup
|
29 |
+
|
30 |
+
# Install noVNC
|
31 |
+
RUN git clone https://github.com/novnc/noVNC.git /root/noVNC
|
32 |
+
|
33 |
+
# Copy startup script
|
34 |
+
COPY startup.sh /root/startup.sh
|
35 |
+
RUN chmod +x /root/startup.sh
|
36 |
+
|
37 |
+
# Set USER environment variable
|
38 |
+
ENV USER=root
|
39 |
+
|
40 |
+
# Expose NoVNC port
|
41 |
+
EXPOSE 5901
|
42 |
+
EXPOSE 6081
|
43 |
+
|
44 |
+
# Start the VNC server and noVNC
|
45 |
+
CMD ["/root/startup.sh"]
|
deploy.yaml
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
apiVersion: apps/v1
|
2 |
+
kind: Deployment
|
3 |
+
metadata:
|
4 |
+
name: ubuntu-xfce-vnc
|
5 |
+
labels:
|
6 |
+
app: ubuntu-xfce-vnc
|
7 |
+
spec:
|
8 |
+
replicas: 1
|
9 |
+
selector:
|
10 |
+
matchLabels:
|
11 |
+
app: ubuntu-xfce-vnc
|
12 |
+
template:
|
13 |
+
metadata:
|
14 |
+
labels:
|
15 |
+
app: ubuntu-xfce-vnc
|
16 |
+
spec:
|
17 |
+
containers:
|
18 |
+
- name: ubuntu-xfce-vnc
|
19 |
+
image: <your registry>
|
20 |
+
ports:
|
21 |
+
- containerPort: 5900
|
22 |
+
name: vnc
|
23 |
+
- containerPort: 6081
|
24 |
+
name: novnc
|
startup.sh
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/sh
|
2 |
+
|
3 |
+
export DISPLAY=:1.0
|
4 |
+
|
5 |
+
# Start novnc
|
6 |
+
/root/noVNC/utils/novnc_proxy --vnc localhost:5901 --listen 0.0.0.0:6081 &
|
7 |
+
|
8 |
+
# Start the VNC server
|
9 |
+
vncserver -geometry 1280x800 -depth 24
|
10 |
+
|
11 |
+
# Start autocutsel to sync clipboard
|
12 |
+
autocutsel -fork
|
13 |
+
|
14 |
+
tail /root/.vnc/*.log # <---- this is where the VNC logs are
|
xstartup
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/bash
|
2 |
+
xrdb $HOME/.Xresources
|
3 |
+
startxfce4 &
|