| FROM debian:bullseye-slim | |
| # 安装 CA 证书(HTTPS 必需) | |
| RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/* | |
| # 创建非 root 用户 | |
| RUN adduser --uid 1000 --disabled-password --gecos "" user && mkdir -p /app && chown -R user /app | |
| USER user | |
| WORKDIR /app | |
| # 复制二进制文件 | |
| COPY hdapi-linux-amd64 /app/hdhive-test | |
| # 添加执行权限(临时切换 root) | |
| USER root | |
| RUN chmod +x /app/hdhive-test | |
| USER user | |
| EXPOSE 8890 | |
| CMD ["/app/hdhive-test"] |