Spaces:
Runtime error
Runtime error
Download Dockerfile from himanshu-711/vs-code-2: direct link, hf CLI and curl.
- Browser
- Download file 906 Bytes
-
https://huggingface.co/spaces/himanshu-711/vs-code-2/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/himanshu-711/vs-code-2/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/himanshu-711/vs-code-2/resolve/main/Dockerfile
906 Bytes
| # Use a stable Ubuntu base | |
| FROM ubuntu:22.04 | |
| # Avoid prompts during package installation | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| # 1. Install sudo, git, and basic build tools | |
| RUN apt-get update && apt-get install -y \ | |
| sudo \ | |
| git \ | |
| curl \ | |
| wget \ | |
| build-essential \ | |
| python3 \ | |
| python3-pip \ | |
| unzip \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # 2. Install code-server (VS Code Web) | |
| RUN curl -fsSL https://code-server.dev/install.sh | sh | |
| # 3. Create a user 'user' with ID 1000 (HF requirement) | |
| RUN useradd -m -u 1000 user && \ | |
| echo "user ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers | |
| # 4. Set environment variables | |
| USER user | |
| ENV HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH | |
| WORKDIR $HOME | |
| # 5. Expose the port HF uses | |
| EXPOSE 7860 | |
| # 6. Start code-server on the correct port with no password for ease of use | |
| CMD ["code-server", "--bind-addr", "0.0.0.0:7860", "--auth", "none", "."] |