You've already forked hugo-docker
mirror of
https://github.com/jakejarvis/hugo-docker.git
synced 2025-07-01 23:56:42 -04:00
Compare commits
37 Commits
Author | SHA1 | Date | |
---|---|---|---|
048f5d17f2
|
|||
5c457e33fe
|
|||
0a8ca90615
|
|||
8b514c58d7
|
|||
20f98c58b7
|
|||
a10483b36a
|
|||
e5a6870534
|
|||
62b12c0d22
|
|||
df27582975
|
|||
6cc3f39751
|
|||
8540c876dd
|
|||
e806604521
|
|||
7fc2ac2b8e
|
|||
56a30dab8f
|
|||
f49e3b1dcd
|
|||
2de4b89509
|
|||
10103bce3b
|
|||
fcb292357c
|
|||
61fa24ed38
|
|||
250387c4f1
|
|||
6e5386c78a
|
|||
86af318435
|
|||
5bbac6174f
|
|||
9fc7783e5a
|
|||
4f26d81802
|
|||
de42257aa2
|
|||
e10c7362c7
|
|||
5bd125e947
|
|||
92aeed4a00
|
|||
23cd994860
|
|||
5bbdb9ba12
|
|||
b69006cb54
|
|||
f0b59209e5
|
|||
061289816b | |||
e59900daaa
|
|||
92748c6c0f | |||
18a14635c0
|
16
.github/workflows/build.yml
vendored
16
.github/workflows/build.yml
vendored
@ -14,7 +14,7 @@ jobs:
|
|||||||
if: "!contains(github.event.head_commit.message, '[skip ci]')"
|
if: "!contains(github.event.head_commit.message, '[skip ci]')"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Prepare tags
|
- name: Prepare tags
|
||||||
id: tag
|
id: tag
|
||||||
@ -34,16 +34,16 @@ jobs:
|
|||||||
echo ::set-output name=tags::${TAGS}
|
echo ::set-output name=tags::${TAGS}
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@master
|
uses: docker/setup-qemu-action@v2
|
||||||
with:
|
with:
|
||||||
platforms: all
|
platforms: linux/amd64,linux/arm64
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
uses: docker/setup-buildx-action@master
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
- name: Cache Docker layers
|
- name: Cache Docker layers
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: /tmp/.buildx-cache
|
path: /tmp/.buildx-cache
|
||||||
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||||
@ -52,14 +52,14 @@ jobs:
|
|||||||
|
|
||||||
- name: Login to DockerHub
|
- name: Login to DockerHub
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
uses: docker/login-action@v1
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
username: jakejarvis
|
username: jakejarvis
|
||||||
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to GitHub Container Registry
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
uses: docker/login-action@v1
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.repository_owner }}
|
username: ${{ github.repository_owner }}
|
||||||
@ -67,7 +67,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
id: build
|
id: build
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v3
|
||||||
with:
|
with:
|
||||||
builder: ${{ steps.buildx.outputs.name }}
|
builder: ${{ steps.buildx.outputs.name }}
|
||||||
context: ./
|
context: ./
|
||||||
|
19
Dockerfile
19
Dockerfile
@ -1,11 +1,11 @@
|
|||||||
# the following version can be overridden at image build time with --build-arg
|
# the following version can be overridden at image build time with --build-arg
|
||||||
ARG HUGO_VERSION=0.93.1
|
ARG HUGO_VERSION=0.110.0
|
||||||
# remove/comment the following line completely to compile vanilla Hugo:
|
# remove/comment the following line completely to compile vanilla Hugo:
|
||||||
ARG HUGO_BUILD_TAGS=extended
|
ARG HUGO_BUILD_TAGS=extended
|
||||||
|
|
||||||
# Hugo >= v0.81.0 requires Go 1.16+ to build
|
# Hugo >= v0.81.0 requires Go 1.16+ to build
|
||||||
ARG GO_VERSION=1.17
|
ARG GO_VERSION=1.19
|
||||||
ARG ALPINE_VERSION=3.15
|
ARG ALPINE_VERSION=3.16
|
||||||
|
|
||||||
# ---
|
# ---
|
||||||
|
|
||||||
@ -28,8 +28,7 @@ RUN apk add --update --no-cache \
|
|||||||
gcc \
|
gcc \
|
||||||
g++ \
|
g++ \
|
||||||
musl-dev \
|
musl-dev \
|
||||||
git && \
|
git
|
||||||
go get github.com/magefile/mage
|
|
||||||
|
|
||||||
# clone source from Git repo:
|
# clone source from Git repo:
|
||||||
RUN git clone \
|
RUN git clone \
|
||||||
@ -38,11 +37,13 @@ RUN git clone \
|
|||||||
--depth 1 \
|
--depth 1 \
|
||||||
https://github.com/gohugoio/hugo.git ./
|
https://github.com/gohugoio/hugo.git ./
|
||||||
|
|
||||||
RUN mage -v hugo && mage install
|
# https://github.com/gohugoio/hugo/commit/241481931f5f5f2803cd4be519936b26d8648dfd
|
||||||
|
RUN go build -v -ldflags "-X github.com/gohugoio/hugo/common/hugo.vendorInfo=docker" -tags "$HUGO_BUILD_TAGS" && \
|
||||||
|
mv ./hugo /go/bin/hugo
|
||||||
|
|
||||||
# fix potential stack size problems on Alpine
|
# fix potential stack size problems on Alpine
|
||||||
# https://github.com/microsoft/vscode-dev-containers/blob/fb63f7e016877e13535d4116b458d8f28012e87f/containers/hugo/.devcontainer/Dockerfile#L19
|
# https://github.com/microsoft/vscode-dev-containers/blob/fb63f7e016877e13535d4116b458d8f28012e87f/containers/hugo/.devcontainer/Dockerfile#L19
|
||||||
RUN go get github.com/yaegashi/muslstack && \
|
RUN go install github.com/yaegashi/muslstack@latest && \
|
||||||
muslstack -s 0x800000 /go/bin/hugo
|
muslstack -s 0x800000 /go/bin/hugo
|
||||||
|
|
||||||
# ---
|
# ---
|
||||||
@ -52,9 +53,9 @@ FROM alpine:${ALPINE_VERSION}
|
|||||||
# renew global args from above & pin any dependency versions
|
# renew global args from above & pin any dependency versions
|
||||||
ARG HUGO_VERSION
|
ARG HUGO_VERSION
|
||||||
# https://github.com/jgm/pandoc/releases
|
# https://github.com/jgm/pandoc/releases
|
||||||
ARG PANDOC_VERSION=2.17.1.1
|
ARG PANDOC_VERSION=2.19.2
|
||||||
# https://github.com/sass/dart-sass-embedded/releases
|
# https://github.com/sass/dart-sass-embedded/releases
|
||||||
ARG DART_SASS_VERSION=1.49.9
|
ARG DART_SASS_VERSION=1.57.1
|
||||||
|
|
||||||
LABEL version="${HUGO_VERSION}"
|
LABEL version="${HUGO_VERSION}"
|
||||||
LABEL repository="https://github.com/jakejarvis/hugo-docker"
|
LABEL repository="https://github.com/jakejarvis/hugo-docker"
|
||||||
|
Reference in New Issue
Block a user