
floryn90/hugo,满足不同功能需求ci 标签镜像,默认配置适合持续集成/部署环境onbuild 标签镜像简化静态网站构建流程基于 Busybox 的极简镜像:
latest、busybox、busybox-ci、ci、busybox-onbuild、onbuild0.151.2-busybox、0.151.2、0.151.2-busybox-ci、0.151.2-ci、0.151.2-busybox-onbuild、0.151.2-onbuild基于 Alpine 的极简镜像:
alpine、alpine-ci、alpine-onbuildext-alpine、ext-alpine-ci、ext-alpine-onbuild0.151.2-alpine、0.151.2-alpine-ci、0.151.2-alpine-onbuild、0.151.2-ext-alpine、0.151.2-ext-alpine-ci、0.151.2-ext-alpine-onbuild基于 Alpine 并预安装 Asciidoctor 的镜像:
asciidoctor、asciidoctor-ci、asciidoctor-onbuild、ext-asciidoctor、ext-asciidoctor-ci、ext-asciidoctor-onbuild0.151.2-asciidoctor、0.151.2-asciidoctor-onbuild、0.151.2-asciidoctor-ci、0.151.2-ext-asciidoctor、0.151.2-ext-asciidoctor-ci、0.151.2-ext-asciidoctor-onbuild基于 Alpine 并预安装 Pandoc 的镜像:
pandoc、pandoc-ci、pandoc-onbuild、ext-pandoc、ext-pandoc-ci、ext-pandoc-onbuild0.151.2-pandoc、0.151.2-pandoc-ci、0.151.2-pandoc-onbuild、0.151.2-ext-pandoc、0.151.2-ext-pandoc-ci、0.151.2-ext-pandoc-onbuild基于 Debian 的镜像:
debian、debian-ci、debian-onbuild、ext、latest-ext、ext-debian、ext-debian-ci、ext-ci、ext-debian-onbuild、ext-onbuild0.151.2-debian、0.151.2-debian-ci、0.151.2-debian-onbuild、0.151.2-ext、0.151.2-ext-debian、0.151.2-ext-debian-ci、0.151.2-ext-ci、0.151.2-ext-debian-onbuild、0.151.2-ext-onbuild基于 Ubuntu 的镜像:
ubuntu、ubuntu-ci、ubuntu-onbuild、ext-ubuntu、ext-ubuntu-ci、ext-ubuntu-onbuild0.151.2-ubuntu、0.151.2-ubuntu-ci、0.151.2-ubuntu-onbuild、0.151.2-ext-ubuntu、0.151.2-ext-ubuntu-ci、0.151.2-ext-ubuntu-onbuild如需旧版本标签,请查看 完整标签列表。
shelldocker run --rm -it \ -v $(pwd):/src \ floryn90/hugo:0.151.2
shelldocker run --rm -it \ -v $(pwd):/src \ -p 1313:1313 \ floryn90/hugo:0.151.2 \ server
yamlversion: '3' services: build: image: floryn90/hugo:0.151.2 volumes: - ".:/src"
yamlversion: '3' services: server: image: floryn90/hugo:0.151.2 command: server volumes: - ".:/src" ports: - "1313:1313"
在 .github/workflows/hugo.yml 中配置:
yamlname: Hugo 构建 on: [push] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: 执行 Hugo 构建 uses: floryn90/actions-hugo@1.0.0
更多配置详见 floryn90/actions-hugo。
在 .travis.yml 中配置:
yamllanguage: bash services: - docker script: - docker run --rm -i \ -v $(pwd):/src \ floryn90/hugo:0.151.2
使用
bash环境可加快 Travis 初始化速度。
Alpine/Debian/Ubuntu 系列镜像(含 Asciidoctor/Pandoc 版本)提供 Hugo Shell(bash + Hugo 自动补全)。进入项目 Shell:
shelldocker run --rm -it \ -v $(pwd):/src \ floryn90/hugo:0.151.2-alpine \ shell
名称含 ext 的镜像使用 Hugo 扩展版,提供额外工具支持。扩展功能支持情况如下表:
| 功能 | Alpine 支持版本 | Debian 支持版本 | Ubuntu 支持版本 |
|---|---|---|---|
| Hugo 扩展版 | 0.43 | 0.43 | 0.43 |
| PostCSS | 0.56.0 | 0.43 | 0.43 |
| NodeJS | 0.54.0 | 0.54.0 | 0.54.0 |
| Yarn | 0.54.0 | 0.54.0 | 0.54.0 |
| Git | 0.56.0 | 0.56.0 | 0.56.0 |
| Autoprefixer | 0.57.0 | 0.57.0 | 0.57.0 |
| Go | 0.68.0 | 0.68.0 | 0.68.0 |
| Babel | 0.71.0 | 0.71.0 | 0.71.0 |
| rst2html | 0.81.0 | 0.81.0 | 0.81.0 |
google/docsy 用户可使用 0.57.2 及以上版本的扩展镜像构建项目。
onbuild 标签镜像会自动将 Dockerfile 所在目录内容复制到 /src 并构建到 /target(0.68.0 前为 /onbuild)。
Dockerfile# 构建阶段 FROM floryn90/hugo:0.151.2-onbuild AS hugo # 部署阶段 FROM nginx COPY --from=hugo /target /usr/share/nginx/html
| 参数名 | 说明 | 默认值 |
|---|---|---|
| HUGO_CMD | 构建时传递给 Hugo 的命令 | 空 |
| HUGO_DESTINATION_ARG | 输出目录位置 | /target |
| HUGO_ENV_ARG | 环境选择("DEV"/"production") | DEV |
| HUGO_DIR | Hugo 根目录 | /src |
ci 标签镜像专为持续集成/部署环境优化,与普通镜像的区别:
HUGO_ENV 默认设为 production含 Pandoc 的镜像支持 Hugo 外部格式转换。Hugo 默认通过 pandoc --mathjax 触发转换,可通过 HUGO_PANDOC 环境变量自定义参数:
shelldocker run --rm -it \ -v $(pwd):/src \ -e HUGO_PANDOC="pandoc-default --strip-empty-paragraphs" \ floryn90/hugo:0.151.2-pandoc
镜像中将原生
pandoc重命名为pandoc-default,通过HUGO_PANDOC定义的别名pandoc调用。
默认入口点为 hugo 包装脚本,如需直接使用原生 Hugo 可指定 hugo-official 入口点:
shelldocker run --rm -it \ -v $(pwd):/src \ --entrypoint hugo-official \ floryn90/hugo:0.151.2
yamlversion: '3' services: build: image: floryn90/hugo:0.151.2 entrypoint: hugo-official volumes: - ".:/src"
| 软件 | 版本 |
|---|---|
| Go | 1.20.1 |
| NodeJS | 19.x |
| Pandoc | 3.1 |
| Yarn | 1.58.3 |
| 变量名 | 说明 | 默认值 |
|---|---|---|
| HUGO_BIND | 服务器绑定地址 | 0.0.0.0 |
| HUGO_CACHEDIR | 模块缓存目录 | /tmp |
| HUGO_DESTINATION | 输出目录 | public |
| HUGO_PANDOC | Pandoc 命令别名内容 | pandoc-default |
| HUGO_ENV | 环境标识("DEV"/"production") | DEV |
| HUGO_VERSION | 镜像内置 Hugo 版本 | 当前版本 |
| HUGO_VERSION_OVERRIDE | 覆盖使用的 Hugo 版本(0.71.1+) | 空 |
1313/tcp:Hugo 开发服务器默认端口


manifest unknown 错误
TLS 证书验证失败
DNS 解析超时
410 错误:版本过低
402 错误:流量耗尽
身份认证失败错误
429 限流错误
凭证保存错误
来自真实用户的反馈,见证轩辕镜像的优质服务