Spaces:
Sleeping
Sleeping
fix: split Dockerfile apt-get calls (match proven build pattern)
Browse filesUse openssl passwd instead of chpasswd, split apt-get into two
separate calls matching the old Dockerfile that built successfully.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Dockerfile +20 -14
Dockerfile
CHANGED
|
@@ -5,22 +5,28 @@ FROM ubuntu:24.04
|
|
| 5 |
|
| 6 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 7 |
|
| 8 |
-
#
|
| 9 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 10 |
-
ca-certificates curl wget git git-lfs \
|
| 11 |
-
python3 python3-pip python3-venv \
|
| 12 |
-
openssh-server nginx ttyd rsync zstd \
|
| 13 |
-
procps htop vim nano less tmux build-essential \
|
| 14 |
&& pip3 install --no-cache-dir --break-system-packages huggingface_hub websockets \
|
| 15 |
&& git lfs install \
|
| 16 |
&& rm -rf /var/lib/apt/lists/*
|
| 17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
# Node.js 20 LTS (for Claude Code)
|
| 19 |
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
|
| 20 |
&& apt-get install -y nodejs \
|
| 21 |
&& rm -rf /var/lib/apt/lists/*
|
| 22 |
|
| 23 |
-
# Claude Code
|
| 24 |
RUN npm install -g @anthropic-ai/claude-code 2>/dev/null \
|
| 25 |
|| (curl -fsSL https://claude.ai/install.sh | bash && \
|
| 26 |
cp /root/.local/bin/claude /usr/local/bin/claude 2>/dev/null || true)
|
|
@@ -28,23 +34,23 @@ RUN npm install -g @anthropic-ai/claude-code 2>/dev/null \
|
|
| 28 |
# Snapshot base package list (to detect user-added packages later)
|
| 29 |
RUN dpkg-query -W -f='${Package}\n' | sort > /etc/base-packages.list
|
| 30 |
|
| 31 |
-
# SSH host keys
|
| 32 |
RUN ssh-keygen -A && mkdir -p /run/sshd
|
| 33 |
|
| 34 |
-
# User account
|
| 35 |
-
RUN useradd -m -u 1000 -s /bin/bash user 2>/dev/null || true
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
RUN mkdir -p /data
|
| 40 |
|
| 41 |
-
# v2: only 3 files
|
| 42 |
COPY entrypoint.py /entrypoint.py
|
| 43 |
COPY nginx.conf /etc/nginx/nginx.conf
|
| 44 |
COPY ws_ssh_bridge.py /ws_ssh_bridge.py
|
| 45 |
|
| 46 |
ENV PERSIST_PATH=/data
|
| 47 |
ENV PYTHONUNBUFFERED=1
|
| 48 |
-
EXPOSE 7860
|
| 49 |
|
|
|
|
|
|
|
| 50 |
ENTRYPOINT ["python3", "-u", "/entrypoint.py"]
|
|
|
|
| 5 |
|
| 6 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 7 |
|
| 8 |
+
# Core: Python + git-lfs + huggingface_hub
|
| 9 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 10 |
+
ca-certificates curl wget python3 python3-pip python3-venv git git-lfs \
|
|
|
|
|
|
|
|
|
|
| 11 |
&& pip3 install --no-cache-dir --break-system-packages huggingface_hub websockets \
|
| 12 |
&& git lfs install \
|
| 13 |
&& rm -rf /var/lib/apt/lists/*
|
| 14 |
|
| 15 |
+
# Server: SSH + nginx + ttyd + tools
|
| 16 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 17 |
+
openssh-server openssh-client \
|
| 18 |
+
nginx \
|
| 19 |
+
ttyd \
|
| 20 |
+
procps htop vim nano less tmux \
|
| 21 |
+
build-essential rsync zstd \
|
| 22 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 23 |
+
|
| 24 |
# Node.js 20 LTS (for Claude Code)
|
| 25 |
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
|
| 26 |
&& apt-get install -y nodejs \
|
| 27 |
&& rm -rf /var/lib/apt/lists/*
|
| 28 |
|
| 29 |
+
# Claude Code (install globally so all users can access)
|
| 30 |
RUN npm install -g @anthropic-ai/claude-code 2>/dev/null \
|
| 31 |
|| (curl -fsSL https://claude.ai/install.sh | bash && \
|
| 32 |
cp /root/.local/bin/claude /usr/local/bin/claude 2>/dev/null || true)
|
|
|
|
| 34 |
# Snapshot base package list (to detect user-added packages later)
|
| 35 |
RUN dpkg-query -W -f='${Package}\n' | sort > /etc/base-packages.list
|
| 36 |
|
| 37 |
+
# SSH: host keys + privilege separation directory
|
| 38 |
RUN ssh-keygen -A && mkdir -p /run/sshd
|
| 39 |
|
| 40 |
+
# User account (for SSH login); container runs as root for system persistence
|
| 41 |
+
RUN useradd -m -u 1000 -s /bin/bash -p "$(openssl passwd -6 huggingrun)" user 2>/dev/null || true
|
| 42 |
+
# Root password for SSH login as root
|
| 43 |
+
RUN usermod -p "$(openssl passwd -6 huggingrun)" root
|
|
|
|
| 44 |
RUN mkdir -p /data
|
| 45 |
|
| 46 |
+
# v2: only 3 files (entrypoint + nginx + ws-bridge)
|
| 47 |
COPY entrypoint.py /entrypoint.py
|
| 48 |
COPY nginx.conf /etc/nginx/nginx.conf
|
| 49 |
COPY ws_ssh_bridge.py /ws_ssh_bridge.py
|
| 50 |
|
| 51 |
ENV PERSIST_PATH=/data
|
| 52 |
ENV PYTHONUNBUFFERED=1
|
|
|
|
| 53 |
|
| 54 |
+
# Run as root (needed for: apt install persistence, bind mounts, sshd)
|
| 55 |
+
EXPOSE 7860
|
| 56 |
ENTRYPOINT ["python3", "-u", "/entrypoint.py"]
|