vs-code-2 / Dockerfile
himanshu-711's picture
Update Dockerfile
030314c verified
Raw
History Blame Contribute Delete
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", "."]