Download Dockerfile from OnBhar/vscode: direct link, hf CLI and curl.
- Browser
- Download file 3.96 kB
-
https://huggingface.co/spaces/OnBhar/vscode/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/OnBhar/vscode/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/OnBhar/vscode/resolve/main/Dockerfile
3.96 kB
| # =============================== | |
| # Base: Ubuntu 22.04 | |
| # code-server + Go + Node.js + PHP + Python | |
| # XFCE + TigerVNC + noVNC | |
| # =============================== | |
| FROM ubuntu:22.04 | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| ENV NVM_DIR=/usr/local/nvm | |
| ENV NODE_VERSION=22 | |
| ENV GO_VERSION=1.23.2 | |
| ENV PATH=$NVM_DIR/versions/node/v$NODE_VERSION/bin:/usr/local/go/bin:$PATH | |
| # ------------------------------- | |
| # Create coder user (passwordless sudo) | |
| # ------------------------------- | |
| USER root | |
| RUN apt-get update && apt-get install -y sudo \ | |
| && useradd -m -s /bin/bash coder \ | |
| && echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers | |
| WORKDIR /home/coder | |
| # ------------------------------- | |
| # System Dependencies | |
| # ------------------------------- | |
| RUN apt-get update && apt-get install -y \ | |
| curl \ | |
| wget \ | |
| git \ | |
| unzip \ | |
| zip \ | |
| gnupg \ | |
| ca-certificates \ | |
| software-properties-common \ | |
| build-essential \ | |
| python3 \ | |
| python3-pip \ | |
| python3-venv \ | |
| php \ | |
| php-cli \ | |
| php-mbstring \ | |
| php-xml \ | |
| php-curl \ | |
| php-zip \ | |
| php-gd \ | |
| php-bcmath \ | |
| php-intl \ | |
| redis-tools \ | |
| openjdk-17-jdk \ | |
| clang \ | |
| cmake \ | |
| ninja-build \ | |
| pkg-config \ | |
| \ | |
| # XFCE Desktop | |
| xfce4 \ | |
| xfce4-goodies \ | |
| \ | |
| # VNC + noVNC | |
| tigervnc-standalone-server \ | |
| novnc \ | |
| websockify \ | |
| \ | |
| # Node.js / npm | |
| nodejs \ | |
| npm \ | |
| \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # ------------------------------- | |
| # Install Go | |
| # ------------------------------- | |
| RUN curl -LO https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz \ | |
| && tar -C /usr/local -xzf go${GO_VERSION}.linux-amd64.tar.gz \ | |
| && rm go${GO_VERSION}.linux-amd64.tar.gz | |
| # ------------------------------- | |
| # Install NVM + Node 22 + Yarn + pnpm | |
| # ------------------------------- | |
| RUN mkdir -p $NVM_DIR \ | |
| && curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash \ | |
| && . $NVM_DIR/nvm.sh \ | |
| && nvm install $NODE_VERSION \ | |
| && nvm use $NODE_VERSION \ | |
| && npm install -g yarn pnpm \ | |
| && ln -sf $NVM_DIR/versions/node/v$NODE_VERSION/bin/node /usr/local/bin/node \ | |
| && ln -sf $NVM_DIR/versions/node/v$NODE_VERSION/bin/npm /usr/local/bin/npm \ | |
| && ln -sf $NVM_DIR/versions/node/v$NODE_VERSION/bin/npx /usr/local/bin/npx \ | |
| && ln -sf $NVM_DIR/versions/node/v$NODE_VERSION/bin/yarn /usr/local/bin/yarn \ | |
| && ln -sf $NVM_DIR/versions/node/v$NODE_VERSION/bin/pnpm /usr/local/bin/pnpm | |
| # ------------------------------- | |
| # Install ngrok | |
| # ------------------------------- | |
| RUN curl -s https://ngrok-agent.s3.amazonaws.com/ngrok.asc \ | |
| | tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null \ | |
| && echo "deb https://ngrok-agent.s3.amazonaws.com buster main" \ | |
| | tee /etc/apt/sources.list.d/ngrok.list \ | |
| && apt-get update \ | |
| && apt-get install -y ngrok \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # ------------------------------- | |
| # Install code-server | |
| # ------------------------------- | |
| RUN curl -fsSL https://code-server.dev/install.sh | sh | |
| # ------------------------------- | |
| # XFCE + VNC configuration | |
| # ------------------------------- | |
| USER coder | |
| RUN mkdir -p /home/coder/.vnc \ | |
| /home/coder/.config \ | |
| /home/coder/.local/share/code-server \ | |
| /home/coder/workspace | |
| # VNC startup script | |
| RUN printf '%s\n' \ | |
| '#!/bin/sh' \ | |
| 'unset SESSION_MANAGER' \ | |
| 'unset DBUS_SESSION_BUS_ADDRESS' \ | |
| 'startxfce4 &' \ | |
| > /home/coder/.vnc/xstartup \ | |
| && chmod +x /home/coder/.vnc/xstartup | |
| # ------------------------------- | |
| # Workspace | |
| # ------------------------------- | |
| WORKDIR /home/coder/workspace | |
| # ------------------------------- | |
| # Ports | |
| # ------------------------------- | |
| # 7860 = code-server | |
| # 5901 = VNC | |
| # 6080 = noVNC | |
| EXPOSE 7860 5901 6080 | |
| # ------------------------------- | |
| # Start code-server | |
| # ------------------------------- | |
| CMD ["bash", "-c", "code-server --bind-addr 0.0.0.0:7860 --auth password --user-data-dir /home/coder/.local/share/code-server"] |