Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
Expand Down
103 changes: 103 additions & 0 deletions template/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
104 changes: 1 addition & 103 deletions template/e2b.Dockerfile
Original file line number Diff line number Diff line change
@@ -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