Skip to content

Commit cca3362

Browse files
committed
Optimize Docker build to touch all source files for proper recompilation
1 parent aff8502 commit cca3362

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ RUN cargo build --release 2>/dev/null || true
3131
COPY src/ src/
3232
COPY benches/ benches/
3333

34-
# 重新构建实际应用(touch 触发重新编译
35-
RUN touch src/main.rs && cargo build --release
34+
# 重新构建实际应用(touch 所有源文件触发重新编译
35+
RUN find src -type f -exec touch {} + && cargo build --release
3636

3737
# ─────────────────────────────────────────────────────────────────────────────
3838
# 阶段 2:runtime — 最小化运行时镜像

0 commit comments

Comments
 (0)