From 8edc87e797d39e82aaac1737759dc8490f647c9f Mon Sep 17 00:00:00 2001 From: Jakub Novak Date: Fri, 18 Jul 2025 10:50:40 +0200 Subject: [PATCH] Use published docker image for build --- .github/workflows/template.yml | 2 +- template/Dockerfile | 103 ++++++++++++++++++++++++++++++++ template/e2b.Dockerfile | 104 +-------------------------------- 3 files changed, 105 insertions(+), 104 deletions(-) create mode 100644 template/Dockerfile diff --git a/.github/workflows/template.yml b/.github/workflows/template.yml index 2b04475..aa9bc0d 100644 --- a/.github/workflows/template.yml +++ b/.github/workflows/template.yml @@ -36,7 +36,7 @@ jobs: run: | docker pull ${{ secrets.DOCKERHUB_USERNAME }}/desktop:latest || true docker buildx build \ - --file e2b.Dockerfile \ + --file Dockerfile \ --platform linux/amd64 \ --push \ --tag ${{ secrets.DOCKERHUB_USERNAME }}/desktop:latest . diff --git a/template/Dockerfile b/template/Dockerfile new file mode 100644 index 0000000..89933a2 --- /dev/null +++ b/template/Dockerfile @@ -0,0 +1,103 @@ +# E2B Desktop Sandbox Template +# +# This Dockerfile contains the commands to create a computer use sandbox on E2B. +# If you want to make your own template based on this one, make your changes + +FROM ubuntu:22.04 + +# Environment variables: + +ENV \ + # Avoid system prompts: \ + DEBIAN_FRONTEND=noninteractive \ + DEBIAN_PRIORITY=high \ + # Pip settings: \ + PIP_DEFAULT_TIMEOUT=100 \ + PIP_DISABLE_PIP_VERSION_CHECK=1 \ + PIP_NO_CACHE_DIR=1 + +# Desktop environment: + +RUN yes | unminimize && \ + apt-get update && \ + # X window server: + apt-get install -y xserver-xorg xorg x11-xserver-utils xvfb x11-utils xauth && \ + # XFCE desktop environment: + apt-get install -y xfce4 xfce4-goodies && \ + # Basic system utilities: + apt-get install -y util-linux sudo curl git wget && \ + # Pip will be used to install Python packages: + apt-get install -y python3-pip && \ + # Tools used by the desktop SDK: + apt-get install -y xdotool scrot ffmpeg + +# Streaming server: + +RUN \ + # VNC: \ + apt-get install -y x11vnc && \ + # NoVNC: \ + git clone --branch e2b-desktop https://github.com/e2b-dev/noVNC.git /opt/noVNC && \ + ln -s /opt/noVNC/vnc.html /opt/noVNC/index.html && \ + # Websockify: \ + apt-get install -y net-tools netcat && \ + pip install numpy && \ + git clone --branch v0.12.0 https://github.com/novnc/websockify /opt/noVNC/utils/websockify + +# User applications: + +# ~ Make your changes to this template BELOW this line ~ + +# Set the default terminal +RUN ln -sf /usr/bin/xfce4-terminal.wrapper /etc/alternatives/x-terminal-emulator + +# Install standard apps +RUN apt-get install -y x11-apps \ + libreoffice \ + xpdf \ + gedit \ + xpaint \ + tint2 \ + galculator \ + pcmanfm + +# Install Firefox +RUN apt-get install -y software-properties-common && \ + add-apt-repository ppa:mozillateam/ppa && \ + apt-get install -y --no-install-recommends \ + firefox-esr + +# Install Chrome +RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \ + echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list && \ + apt-get update && \ + apt-get install -y google-chrome-stable + +# Set Firefox as default browser +RUN update-alternatives --set x-www-browser /usr/bin/firefox-esr + +# Copy Chrome desktop shortcut +COPY google-chrome.desktop /usr/share/applications/google-chrome.desktop + +# Install VS Code +RUN apt-get install apt-transport-https && \ + wget -qO- https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \ + add-apt-repository -y "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" && \ + apt-get update -y && \ + apt-get install -y code +RUN mkdir -p /home/user/.config/Code/User +COPY ./settings.json /home/user/.config/Code/User/settings.json + +# Copy desktop background for XFCE +COPY ./wallpaper.png /usr/share/backgrounds/xfce/wallpaper.png +RUN mkdir -p /home/user/.config/xfce4/xfconf/xfce-perchannel-xml/ +COPY ./xfce4-desktop.xml /home/user/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml + +# Install gtk-launch and update desktop database +RUN apt-get install -y libgtk-3-bin && \ + update-desktop-database /usr/share/applications/ + +# Copy firefox policies +COPY firefox-policies.json /usr/lib/firefox-esr/distribution/policies.json +COPY firefox-autoconfig.js /usr/lib/firefox-esr/defaults/pref/autoconfig.js +COPY firefox.cfg /usr/lib/firefox-esr/firefox.cfg diff --git a/template/e2b.Dockerfile b/template/e2b.Dockerfile index 89933a2..ea7b048 100644 --- a/template/e2b.Dockerfile +++ b/template/e2b.Dockerfile @@ -1,103 +1 @@ -# E2B Desktop Sandbox Template -# -# This Dockerfile contains the commands to create a computer use sandbox on E2B. -# If you want to make your own template based on this one, make your changes - -FROM ubuntu:22.04 - -# Environment variables: - -ENV \ - # Avoid system prompts: \ - DEBIAN_FRONTEND=noninteractive \ - DEBIAN_PRIORITY=high \ - # Pip settings: \ - PIP_DEFAULT_TIMEOUT=100 \ - PIP_DISABLE_PIP_VERSION_CHECK=1 \ - PIP_NO_CACHE_DIR=1 - -# Desktop environment: - -RUN yes | unminimize && \ - apt-get update && \ - # X window server: - apt-get install -y xserver-xorg xorg x11-xserver-utils xvfb x11-utils xauth && \ - # XFCE desktop environment: - apt-get install -y xfce4 xfce4-goodies && \ - # Basic system utilities: - apt-get install -y util-linux sudo curl git wget && \ - # Pip will be used to install Python packages: - apt-get install -y python3-pip && \ - # Tools used by the desktop SDK: - apt-get install -y xdotool scrot ffmpeg - -# Streaming server: - -RUN \ - # VNC: \ - apt-get install -y x11vnc && \ - # NoVNC: \ - git clone --branch e2b-desktop https://github.com/e2b-dev/noVNC.git /opt/noVNC && \ - ln -s /opt/noVNC/vnc.html /opt/noVNC/index.html && \ - # Websockify: \ - apt-get install -y net-tools netcat && \ - pip install numpy && \ - git clone --branch v0.12.0 https://github.com/novnc/websockify /opt/noVNC/utils/websockify - -# User applications: - -# ~ Make your changes to this template BELOW this line ~ - -# Set the default terminal -RUN ln -sf /usr/bin/xfce4-terminal.wrapper /etc/alternatives/x-terminal-emulator - -# Install standard apps -RUN apt-get install -y x11-apps \ - libreoffice \ - xpdf \ - gedit \ - xpaint \ - tint2 \ - galculator \ - pcmanfm - -# Install Firefox -RUN apt-get install -y software-properties-common && \ - add-apt-repository ppa:mozillateam/ppa && \ - apt-get install -y --no-install-recommends \ - firefox-esr - -# Install Chrome -RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \ - echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list && \ - apt-get update && \ - apt-get install -y google-chrome-stable - -# Set Firefox as default browser -RUN update-alternatives --set x-www-browser /usr/bin/firefox-esr - -# Copy Chrome desktop shortcut -COPY google-chrome.desktop /usr/share/applications/google-chrome.desktop - -# Install VS Code -RUN apt-get install apt-transport-https && \ - wget -qO- https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \ - add-apt-repository -y "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" && \ - apt-get update -y && \ - apt-get install -y code -RUN mkdir -p /home/user/.config/Code/User -COPY ./settings.json /home/user/.config/Code/User/settings.json - -# Copy desktop background for XFCE -COPY ./wallpaper.png /usr/share/backgrounds/xfce/wallpaper.png -RUN mkdir -p /home/user/.config/xfce4/xfconf/xfce-perchannel-xml/ -COPY ./xfce4-desktop.xml /home/user/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml - -# Install gtk-launch and update desktop database -RUN apt-get install -y libgtk-3-bin && \ - update-desktop-database /usr/share/applications/ - -# Copy firefox policies -COPY firefox-policies.json /usr/lib/firefox-esr/distribution/policies.json -COPY firefox-autoconfig.js /usr/lib/firefox-esr/defaults/pref/autoconfig.js -COPY firefox.cfg /usr/lib/firefox-esr/firefox.cfg +FROM e2bdev/desktop:latest