You've already forked hugo-docker
mirror of
https://github.com/jakejarvis/hugo-docker.git
synced 2025-07-02 01:06:41 -04:00
Compare commits
33 Commits
Author | SHA1 | Date | |
---|---|---|---|
18a14635c0
|
|||
3cb403f6fa
|
|||
70c9d418ec
|
|||
4ec3e8be98
|
|||
f1513cf6c7
|
|||
e608453299
|
|||
7a43febe15
|
|||
4898a96b66
|
|||
73e0bf7815
|
|||
d6ca9055b4
|
|||
bca0721d67
|
|||
33bd893ed3
|
|||
d9338044c5
|
|||
cb26219a40
|
|||
f6580ec25c
|
|||
6bc21e062a
|
|||
04930ae9ae
|
|||
eb82474eb8
|
|||
90b15c893d
|
|||
b31b18ac2d
|
|||
4df70ef38c
|
|||
f75b85512b
|
|||
f97154879d
|
|||
4f1d3a9c48
|
|||
22ba6e27d0
|
|||
3123853163
|
|||
5d7840092e
|
|||
7d20947610 | |||
a6b5427dca
|
|||
941079893a
|
|||
8a2fe24434
|
|||
bdf6d208b4
|
|||
de4ef2242f
|
30
Dockerfile
30
Dockerfile
@ -1,14 +1,15 @@
|
||||
# the following version can be overridden at image build time with --build-arg
|
||||
ARG HUGO_VERSION=0.82.1
|
||||
ARG HUGO_VERSION=0.93.2
|
||||
# remove/comment the following line completely to compile vanilla Hugo:
|
||||
ARG HUGO_BUILD_TAGS=extended
|
||||
|
||||
# Hugo >= v0.81.0 requires Go 1.16+ to build
|
||||
ARG GO_VERSION=1.16
|
||||
ARG GO_VERSION=1.17
|
||||
ARG ALPINE_VERSION=3.15
|
||||
|
||||
# ---
|
||||
|
||||
FROM golang:${GO_VERSION}-alpine AS build
|
||||
FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS build
|
||||
|
||||
# renew global args from above
|
||||
# https://docs.docker.com/engine/reference/builder/#scope
|
||||
@ -46,12 +47,14 @@ RUN go get github.com/yaegashi/muslstack && \
|
||||
|
||||
# ---
|
||||
|
||||
FROM alpine:latest
|
||||
FROM alpine:${ALPINE_VERSION}
|
||||
|
||||
# renew global args from above & pin any dependency versions
|
||||
ARG HUGO_VERSION
|
||||
# https://github.com/jgm/pandoc/releases
|
||||
ARG PANDOC_VERSION=2.13
|
||||
ARG PANDOC_VERSION=2.17.1.1
|
||||
# https://github.com/sass/dart-sass-embedded/releases
|
||||
ARG DART_SASS_VERSION=1.49.9
|
||||
|
||||
LABEL version="${HUGO_VERSION}"
|
||||
LABEL repository="https://github.com/jakejarvis/hugo-docker"
|
||||
@ -65,10 +68,13 @@ LABEL org.opencontainers.image.source="https://github.com/jakejarvis/hugo-docker
|
||||
COPY --from=build /go/bin/hugo /usr/bin/hugo
|
||||
|
||||
# this step is intentionally a bit of a mess to minimize the number of layers in the final image
|
||||
RUN if [ "$(uname -m)" = "aarch64" ]; then \
|
||||
export ARCH="arm64"; \
|
||||
RUN set -euo pipefail && \
|
||||
if [ "$(uname -m)" = "x86_64" ]; then \
|
||||
ARCH="amd64"; \
|
||||
elif [ "$(uname -m)" = "aarch64" ]; then \
|
||||
ARCH="arm64"; \
|
||||
else \
|
||||
export ARCH="amd64"; \
|
||||
echo "Unknown build architecture, quitting." && exit 2; \
|
||||
fi && \
|
||||
# alpine packages
|
||||
# libc6-compat & libstdc++ are required for extended SASS libraries
|
||||
@ -105,6 +111,14 @@ RUN if [ "$(uname -m)" = "aarch64" ]; then \
|
||||
mv ./pandoc-${PANDOC_VERSION}/bin/pandoc /usr/bin/ && \
|
||||
chmod +x /usr/bin/pandoc && \
|
||||
rm -rf pandoc.tar.gz pandoc-${PANDOC_VERSION} && \
|
||||
# manually fetch Dart SASS binary (on x64 only)
|
||||
if [ "$ARCH" = "amd64" ]; then \
|
||||
wget -O sass-embedded.tar.gz https://github.com/sass/dart-sass-embedded/releases/download/${DART_SASS_VERSION}/sass_embedded-${DART_SASS_VERSION}-linux-x64.tar.gz && \
|
||||
tar xf sass-embedded.tar.gz && \
|
||||
mv ./sass_embedded/dart-sass-embedded /usr/bin/ && \
|
||||
chmod +x /usr/bin/dart-sass-embedded && \
|
||||
rm -rf sass-embedded.tar.gz sass_embedded; \
|
||||
fi && \
|
||||
# clean up some junk
|
||||
rm -rf /tmp/* /var/tmp/* /var/cache/apk/* && \
|
||||
# make super duper sure that everything went OK, exit otherwise
|
||||
|
@ -1,4 +1,4 @@
|
||||
# ✏️ [Hugo Extended](https://github.com/gohugoio/hugo) via Docker
|
||||
# ✏️ [Hugo Extended](https://github.com/gohugoio/hugo) via Docker
|
||||
|
||||
[](https://github.com/jakejarvis/hugo-docker/actions/workflows/build.yml)
|
||||
|
||||
@ -44,6 +44,7 @@ Just in case, the final Alpine Linux container includes a few small third-party
|
||||
- [Asciidoctor](https://asciidoctor.org/)
|
||||
- [Pandoc](https://pandoc.org/)
|
||||
- [Docutils](https://docutils.sourceforge.io/) / [RST](https://docutils.sourceforge.io/rst.html)
|
||||
- [Embedded Dart Sass](https://github.com/sass/dart-sass-embedded) (amd64 only)
|
||||
|
||||
Node (with NPM and Yarn), Go (for [Hugo Modules](https://gohugo.io/hugo-modules/) support), and Python are also pre-installed.
|
||||
|
||||
|
Reference in New Issue
Block a user