Skip to content

Commit 126648e

Browse files
authored
Update Dockerfile
1 parent fe73be1 commit 126648e

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

Dockerfile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@ RUN hugo version
1818

1919
WORKDIR /build
2020

21-
# 下载 FixIt 主题的 Release 压缩包(避免 git 浅克隆问题)
21+
# 下载 FixIt 主题的 Release 压缩包
2222
ADD https://github.com/hugo-fixit/FixIt/archive/refs/tags/v0.3.6.tar.gz /tmp/
23-
RUN tar -xzf /tmp/v0.3.6.tar.gz -C /tmp && \
24-
mv /tmp/FixIt-0.3.6 /build/themes/FixIt && \
25-
# 复制 exampleSite 内容到当前工作目录
23+
24+
# 解压到 themes/FixIt(自动剥离顶层目录),并复制 exampleSite 内容
25+
RUN mkdir -p /build/themes/FixIt && \
26+
tar -xzf /tmp/v0.3.6.tar.gz -C /build/themes/FixIt --strip-components=1 && \
2627
cp -r /build/themes/FixIt/exampleSite/. /build/
2728

2829
# 修正主题配置:确保主题名称正确
@@ -36,10 +37,10 @@ FROM nginx:stable-alpine
3637

3738
RUN apk add --no-cache bash libstdc++
3839

39-
# 复制 hugo 二进制(从 builder 阶段)
40+
# 复制 hugo 二进制
4041
COPY --from=builder /usr/local/bin/hugo /usr/local/bin/hugo
4142

42-
# 复制默认站点的完整源码(用于运行时动态生成)
43+
# 复制默认站点的完整源码
4344
COPY --from=builder /build /app/default-site
4445
COPY --from=builder /default-public /usr/share/nginx/html
4546

0 commit comments

Comments
 (0)