Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +35 -25
Dockerfile
CHANGED
|
@@ -1,43 +1,53 @@
|
|
| 1 |
FROM debian:bookworm
|
| 2 |
LABEL description="Chrome With noVNC" \
|
| 3 |
-
|
| 4 |
-
|
| 5 |
|
| 6 |
# Install Chrome
|
| 7 |
RUN \
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
RUN \
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
| 20 |
|
| 21 |
-
#
|
| 22 |
COPY chrome-novnc.sh /usr/bin/chrome-novnc.sh
|
| 23 |
RUN \
|
| 24 |
-
|
| 25 |
-
|
| 26 |
|
|
|
|
| 27 |
ENV \
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
VNC_PASSWD=Binhminh12
|
| 32 |
-
|
|
|
|
|
|
|
|
|
|
| 33 |
EXPOSE 7860
|
| 34 |
|
| 35 |
VOLUME /config
|
| 36 |
|
| 37 |
-
|
| 38 |
RUN \
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
|
| 43 |
CMD ["bash", "-c", "/usr/bin/chrome-novnc.sh"]
|
|
|
|
| 1 |
FROM debian:bookworm
|
| 2 |
LABEL description="Chrome With noVNC" \
|
| 3 |
+
maintainer="admin@fever.ink" \
|
| 4 |
+
version="2.1"
|
| 5 |
|
| 6 |
# Install Chrome
|
| 7 |
RUN \
|
| 8 |
+
apt update && \
|
| 9 |
+
apt upgrade -y && \
|
| 10 |
+
apt install --no-install-recommends -y wget fonts-droid-fallback && \
|
| 11 |
+
wget --no-check-certificate https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -O /tmp/google-chrome-stable_current_amd64.deb && \
|
| 12 |
+
apt install --no-install-recommends -f -y /tmp/google-chrome-stable_current_amd64.deb && \
|
| 13 |
+
rm /tmp/google-chrome-stable_current_amd64.deb
|
| 14 |
+
|
| 15 |
+
# Install VNC server and noVNC
|
| 16 |
+
RUN \
|
| 17 |
+
apt install --no-install-recommends -y tightvncserver xfonts-base git websockify python3 net-tools procps && \
|
| 18 |
+
git clone https://github.com/novnc/noVNC.git /opt/novnc
|
| 19 |
+
|
| 20 |
+
# Create directories and set permissions for non-root user
|
| 21 |
RUN \
|
| 22 |
+
mkdir -p /config/google-chrome /config/.vnc && \
|
| 23 |
+
chmod -R 777 /config /opt/novnc && \
|
| 24 |
+
touch /config/.vnc/passwd /config/.vnc/xstartup && \
|
| 25 |
+
chmod 666 /config/.vnc/passwd /config/.vnc/xstartup
|
| 26 |
|
| 27 |
+
# Copy and configure chrome-novnc.sh
|
| 28 |
COPY chrome-novnc.sh /usr/bin/chrome-novnc.sh
|
| 29 |
RUN \
|
| 30 |
+
ln -s /opt/novnc/vnc.html /opt/novnc/index.html && \
|
| 31 |
+
chmod +x /usr/bin/chrome-novnc.sh
|
| 32 |
|
| 33 |
+
# Environment variables
|
| 34 |
ENV \
|
| 35 |
+
WIDTH=1280 \
|
| 36 |
+
HEIGHT=720 \
|
| 37 |
+
LANGUAGE=zh_CN.UTF-8 \
|
| 38 |
+
VNC_PASSWD=Binhminh12 \
|
| 39 |
+
HOME=/config \
|
| 40 |
+
XDG_CONFIG_HOME=/config \
|
| 41 |
+
VNC_DIR=/config/.vnc
|
| 42 |
+
|
| 43 |
EXPOSE 7860
|
| 44 |
|
| 45 |
VOLUME /config
|
| 46 |
|
| 47 |
+
# Clean up
|
| 48 |
RUN \
|
| 49 |
+
apt purge -y git && \
|
| 50 |
+
apt autoremove --purge -y && \
|
| 51 |
+
rm -rf /var/lib/apt/lists/*
|
| 52 |
|
| 53 |
CMD ["bash", "-c", "/usr/bin/chrome-novnc.sh"]
|