- 更新 build-and-deploy 阶段使用 *tools_image - 重构 Dockerfile.tools: 基于 node:20-alpine,添加 git/ssh/rsync/curl/dig/nc - 镜像大小: 60.5MB (包含 Node.js 20 + 所有工具) - 移除临时安装 SSH/rsync 的步骤
This commit is contained in:
+5
-4
@@ -1,12 +1,13 @@
|
||||
FROM --platform=linux/amd64 alpine:3.17
|
||||
FROM --platform=linux/amd64 node:20-alpine
|
||||
|
||||
# 安装所需的工具
|
||||
# 安装额外的工具
|
||||
RUN apk add --no-cache \
|
||||
git \
|
||||
openssh-client \
|
||||
curl \
|
||||
bind-tools \
|
||||
netcat-openbsd
|
||||
netcat-openbsd \
|
||||
rsync
|
||||
|
||||
# 设置时区
|
||||
RUN apk add --no-cache tzdata && \
|
||||
@@ -14,7 +15,7 @@ RUN apk add --no-cache tzdata && \
|
||||
echo "Asia/Shanghai" > /etc/timezone
|
||||
|
||||
# 创建非root用户
|
||||
RUN addgroup -g 1001 -S appgroup && \
|
||||
RUN addgroup -g 1001 appgroup && \
|
||||
adduser -u 1001 -S appuser -G appgroup
|
||||
|
||||
USER appuser
|
||||
|
||||
Reference in New Issue
Block a user