Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +36 -14
Dockerfile
CHANGED
|
@@ -6,7 +6,7 @@ USER root
|
|
| 6 |
RUN apt-get update && apt-get upgrade -y
|
| 7 |
|
| 8 |
# Install desktop environment (XFCE - lightweight)
|
| 9 |
-
RUN apt-get install -y \
|
| 10 |
xfce4 \
|
| 11 |
xfce4-goodies \
|
| 12 |
x11vnc \
|
|
@@ -14,7 +14,8 @@ RUN apt-get install -y \
|
|
| 14 |
supervisor \
|
| 15 |
net-tools \
|
| 16 |
novnc \
|
| 17 |
-
websockify
|
|
|
|
| 18 |
|
| 19 |
# Install Node.js
|
| 20 |
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
|
|
@@ -46,7 +47,10 @@ RUN apt-get install -y \
|
|
| 46 |
libcairo2 \
|
| 47 |
libasound2 \
|
| 48 |
libxrender1 \
|
| 49 |
-
libdbus-1-3
|
|
|
|
|
|
|
|
|
|
| 50 |
|
| 51 |
# Install Java
|
| 52 |
RUN wget https://download.java.net/openjdk/jdk20/ri/openjdk-20+36_linux-x64_bin.tar.gz && \
|
|
@@ -56,15 +60,18 @@ RUN wget https://download.java.net/openjdk/jdk20/ri/openjdk-20+36_linux-x64_bin.
|
|
| 56 |
update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk-20/bin/java" 1 && \
|
| 57 |
update-alternatives --set java /usr/lib/jvm/jdk-20/bin/java
|
| 58 |
|
| 59 |
-
# Install useful
|
| 60 |
RUN apt-get install -y \
|
| 61 |
firefox-esr \
|
| 62 |
gedit \
|
|
|
|
| 63 |
file-roller \
|
| 64 |
git \
|
| 65 |
curl \
|
| 66 |
wget \
|
| 67 |
-
vim
|
|
|
|
|
|
|
| 68 |
|
| 69 |
# Configure fixuid
|
| 70 |
RUN curl -L https://github.com/boxboat/fixuid/releases/download/v0.5/fixuid -o /usr/local/bin/fixuid && \
|
|
@@ -77,22 +84,37 @@ RUN curl -L https://github.com/boxboat/fixuid/releases/download/v0.5/fixuid -o /
|
|
| 77 |
RUN mkdir -p /home/coder/.config && \
|
| 78 |
mkdir -p /home/coder/.local/share/code-server/User && \
|
| 79 |
mkdir -p /home/coder/.vnc && \
|
|
|
|
| 80 |
chmod -R 777 /home/coder/
|
| 81 |
|
| 82 |
-
#
|
| 83 |
-
RUN
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
|
|
|
|
|
|
| 90 |
|
| 91 |
WORKDIR /home/coder/project
|
| 92 |
|
| 93 |
# Expose ports
|
|
|
|
|
|
|
|
|
|
| 94 |
EXPOSE 8080 5900 6080
|
| 95 |
|
| 96 |
USER coder
|
| 97 |
|
| 98 |
-
CMD ["/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
RUN apt-get update && apt-get upgrade -y
|
| 7 |
|
| 8 |
# Install desktop environment (XFCE - lightweight)
|
| 9 |
+
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
| 10 |
xfce4 \
|
| 11 |
xfce4-goodies \
|
| 12 |
x11vnc \
|
|
|
|
| 14 |
supervisor \
|
| 15 |
net-tools \
|
| 16 |
novnc \
|
| 17 |
+
websockify \
|
| 18 |
+
dbus-x11
|
| 19 |
|
| 20 |
# Install Node.js
|
| 21 |
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
|
|
|
|
| 47 |
libcairo2 \
|
| 48 |
libasound2 \
|
| 49 |
libxrender1 \
|
| 50 |
+
libdbus-1-3 \
|
| 51 |
+
libgbm1 \
|
| 52 |
+
libnss3 \
|
| 53 |
+
libnspr4
|
| 54 |
|
| 55 |
# Install Java
|
| 56 |
RUN wget https://download.java.net/openjdk/jdk20/ri/openjdk-20+36_linux-x64_bin.tar.gz && \
|
|
|
|
| 60 |
update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk-20/bin/java" 1 && \
|
| 61 |
update-alternatives --set java /usr/lib/jvm/jdk-20/bin/java
|
| 62 |
|
| 63 |
+
# Install useful applications
|
| 64 |
RUN apt-get install -y \
|
| 65 |
firefox-esr \
|
| 66 |
gedit \
|
| 67 |
+
thunar \
|
| 68 |
file-roller \
|
| 69 |
git \
|
| 70 |
curl \
|
| 71 |
wget \
|
| 72 |
+
vim \
|
| 73 |
+
htop \
|
| 74 |
+
tmux
|
| 75 |
|
| 76 |
# Configure fixuid
|
| 77 |
RUN curl -L https://github.com/boxboat/fixuid/releases/download/v0.5/fixuid -o /usr/local/bin/fixuid && \
|
|
|
|
| 84 |
RUN mkdir -p /home/coder/.config && \
|
| 85 |
mkdir -p /home/coder/.local/share/code-server/User && \
|
| 86 |
mkdir -p /home/coder/.vnc && \
|
| 87 |
+
mkdir -p /var/run/dbus && \
|
| 88 |
chmod -R 777 /home/coder/
|
| 89 |
|
| 90 |
+
# Create startup script
|
| 91 |
+
RUN echo '#!/bin/bash\n\
|
| 92 |
+
export DISPLAY=:1\n\
|
| 93 |
+
Xvfb :1 -screen 0 1920x1080x24 &\n\
|
| 94 |
+
sleep 2\n\
|
| 95 |
+
startxfce4 &\n\
|
| 96 |
+
x11vnc -display :1 -forever -shared -rfbport 5900 -passwd password &\n\
|
| 97 |
+
websockify --web=/usr/share/novnc/ 6080 localhost:5900 &\n\
|
| 98 |
+
code-server --bind-addr 0.0.0.0:8080 --auth none\n\
|
| 99 |
+
' > /start.sh && chmod +x /start.sh
|
| 100 |
|
| 101 |
WORKDIR /home/coder/project
|
| 102 |
|
| 103 |
# Expose ports
|
| 104 |
+
# 8080: code-server
|
| 105 |
+
# 5900: VNC
|
| 106 |
+
# 6080: noVNC (browser-based VNC)
|
| 107 |
EXPOSE 8080 5900 6080
|
| 108 |
|
| 109 |
USER coder
|
| 110 |
|
| 111 |
+
CMD ["/start.sh"]
|
| 112 |
+
```
|
| 113 |
+
|
| 114 |
+
## Step 2: Create Required Files Structure
|
| 115 |
+
|
| 116 |
+
Create this folder structure:
|
| 117 |
+
```
|
| 118 |
+
your-project/
|
| 119 |
+
├── Dockerfile
|
| 120 |
+
└── README.md
|