Skip to content

Commit 3200d3f

Browse files
committed
chore: ignore usergroup add fail
1 parent 935395c commit 3200d3f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,15 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1515

1616
# 使用非 root 用户运行,避免 GitHub Actions Runner 报 "Must not run with sudo"
1717
# UID/GID 1000 与常见宿主机首用户一致,挂载 runners 卷时权限更易匹配
18-
RUN groupadd -g 1000 app && useradd -r -u 1000 -g app -d /app -s /bin/bash app
18+
# 基础镜像可能已有 GID 1000,先尝试创建组,失败则复用已有组
19+
RUN (groupadd -g 1000 app 2>/dev/null || true) && useradd -r -u 1000 -g 1000 -d /app -s /bin/bash app
1920

2021
WORKDIR /app
2122
COPY --from=builder /app/runner-manager .
2223
COPY --from=builder /app/config.yaml ./config.yaml
2324
RUN mkdir -p /app/scripts /app/runners
2425
COPY scripts/install-runner.sh /app/scripts/install-runner.sh
25-
RUN chmod +x /app/scripts/install-runner.sh && chown -R app:app /app
26+
RUN chmod +x /app/scripts/install-runner.sh && chown -R 1000:1000 /app
2627

2728
USER app
2829
EXPOSE 8080

0 commit comments

Comments
 (0)