Skip to content

Commit abcfcd2

Browse files
authored
Update Dockerfile
1 parent fd4164f commit abcfcd2

1 file changed

Lines changed: 1 addition & 11 deletions

File tree

Dockerfile

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
55
git curl ca-certificates golang-go && \
66
rm -rf /var/lib/apt/lists/*
77

8-
# 自动识别架构下载 Hugo
98
ARG TARGETARCH
109
RUN case ${TARGETARCH} in \
1110
"amd64") HUGO_ARCH="64bit" ;; \
@@ -20,27 +19,18 @@ RUN case ${TARGETARCH} in \
2019

2120
RUN hugo version
2221

23-
# 下载站点源码
2422
RUN git clone --depth 1 https://github.com/hugo-fixit/hugo-fixit-starter.git /build
2523
WORKDIR /build
2624

27-
# 构建(现在 go 已安装,不会报错)
2825
RUN hugo --minify --baseURL "/" --destination /public
2926

30-
# 修复路径
3127
RUN find /public -type f -name "*.html" -exec sed -i 's|/hugo-fixit-starter/|/|g' {} \;
32-
33-
# 复制静态资源
3428
RUN cp -r /build/static/* /public/ 2>/dev/null || true
3529

36-
# 创建缺失图标(不依赖 imagemagick,避免报错)
3730
RUN for icon in apple-touch-icon.png favicon-32x32.png favicon-16x16.png; do \
38-
if [ ! -f "/public/$icon" ]; then \
39-
touch /public/$icon; \
40-
fi; \
31+
[ -f "/public/$icon" ] || touch "/public/$icon"; \
4132
done
4233

43-
# 验证
4434
RUN test -f /public/index.html
4535

4636
# 阶段二:运行(跨架构)

0 commit comments

Comments
 (0)