jamesw853 commited on
Commit
e368d06
·
verified ·
1 Parent(s): e1c3dc7

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -5
Dockerfile CHANGED
@@ -16,20 +16,20 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
16
  # 安装 huggingface_hub(用于上传数据集)
17
  RUN pip3 install --no-cache-dir huggingface_hub
18
 
19
- # 创建非 root 用户 (UID 1000)
20
  RUN useradd -m -u 1000 -s /bin/bash user && \
21
  mkdir -p /data && chown -R user:user /data
22
 
23
  USER user
24
  WORKDIR /home/user
25
 
26
- # 直接下载 opencode 二进制(绕过安装脚本)
27
  RUN ARCH=$(uname -m) && \
28
  if [ "$ARCH" = "x86_64" ]; then ARCH="x64"; elif [ "$ARCH" = "aarch64" ]; then ARCH="arm64"; fi && \
29
  OS=$(uname -s | tr '[:upper:]' '[:lower:]') && \
30
  FILENAME="opencode-${OS}-${ARCH}.tar.gz" && \
31
- VERSION="0.0.55" && \
32
- URL="https://github.com/anomalyco/opencode/releases/download/v${VERSION}/${FILENAME}" && \
33
  curl --retry 3 --retry-delay 2 --max-time 60 -fsSL -o /tmp/opencode.tar.gz "${URL}" && \
34
  tar -xzf /tmp/opencode.tar.gz -C /tmp && \
35
  mkdir -p /home/user/.opencode/bin && \
@@ -39,7 +39,7 @@ RUN ARCH=$(uname -m) && \
39
 
40
  ENV PATH="/home/user/.opencode/bin:${PATH}"
41
 
42
- # 复制同步脚本和 supervisor 配置
43
  COPY --chown=user sync_to_dataset.py /home/user/sync_to_dataset.py
44
  COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
45
 
 
16
  # 安装 huggingface_hub(用于上传数据集)
17
  RUN pip3 install --no-cache-dir huggingface_hub
18
 
19
+ # 创建非 root 用户 (UID 1000) 和数据目录
20
  RUN useradd -m -u 1000 -s /bin/bash user && \
21
  mkdir -p /data && chown -R user:user /data
22
 
23
  USER user
24
  WORKDIR /home/user
25
 
26
+ # 安装 opencode:直接下载 latest 二进制(避免版号不匹配
27
  RUN ARCH=$(uname -m) && \
28
  if [ "$ARCH" = "x86_64" ]; then ARCH="x64"; elif [ "$ARCH" = "aarch64" ]; then ARCH="arm64"; fi && \
29
  OS=$(uname -s | tr '[:upper:]' '[:lower:]') && \
30
  FILENAME="opencode-${OS}-${ARCH}.tar.gz" && \
31
+ URL="https://github.com/anomalyco/opencode/releases/latest/download/${FILENAME}" && \
32
+ echo "Downloading ${URL}" && \
33
  curl --retry 3 --retry-delay 2 --max-time 60 -fsSL -o /tmp/opencode.tar.gz "${URL}" && \
34
  tar -xzf /tmp/opencode.tar.gz -C /tmp && \
35
  mkdir -p /home/user/.opencode/bin && \
 
39
 
40
  ENV PATH="/home/user/.opencode/bin:${PATH}"
41
 
42
+ # 复制同步脚本和 supervisor 配置(确保这两个文件已上传)
43
  COPY --chown=user sync_to_dataset.py /home/user/sync_to_dataset.py
44
  COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
45