File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
98ARG TARGETARCH
109RUN case ${TARGETARCH} in \
1110 "amd64" ) HUGO_ARCH="64bit" ;; \
@@ -20,27 +19,18 @@ RUN case ${TARGETARCH} in \
2019
2120RUN hugo version
2221
23- # 下载站点源码
2422RUN git clone --depth 1 https://github.com/hugo-fixit/hugo-fixit-starter.git /build
2523WORKDIR /build
2624
27- # 构建(现在 go 已安装,不会报错)
2825RUN hugo --minify --baseURL "/" --destination /public
2926
30- # 修复路径
3127RUN find /public -type f -name "*.html" -exec sed -i 's|/hugo-fixit-starter/|/|g' {} \;
32-
33- # 复制静态资源
3428RUN cp -r /build/static/* /public/ 2>/dev/null || true
3529
36- # 创建缺失图标(不依赖 imagemagick,避免报错)
3730RUN 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" ; \
4132done
4233
43- # 验证
4434RUN test -f /public/index.html
4535
4636# 阶段二:运行(跨架构)
You can’t perform that action at this time.
0 commit comments