Skip to content

Commit 9ec05c0

Browse files
authored
Update Dockerfile
1 parent b5ec4fe commit 9ec05c0

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Dockerfile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1-
# 使用轻量级基础镜像
1+
# 使用 Alpine 基础镜像
22
FROM alpine:latest
33

4-
# 安装必要工具(如 shell 和 ls 命令
5-
RUN apk add --no-cache bash coreutils
4+
# 关键修复:替换为国内镜像源(阿里云
5+
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
66

7-
# 将仓库内容复制到 /app 目录
7+
# 安装必要工具(合并更新与安装步骤)
8+
RUN apk update && apk add --no-cache bash coreutils
9+
10+
# 复制所有文件到镜像(用于测试 secret leakage)
811
COPY . /app
912

1013
# 设置工作目录
1114
WORKDIR /app
1215

13-
# 默认启动命令:打印欢迎信息和 /app 目录内容
16+
# 启动命令
1417
CMD ["bash", "-c", "echo 'Hello from Docker image' && ls -la /app"]

0 commit comments

Comments
 (0)