mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-04-27 16:16:21 -04:00
docker updates
This commit is contained in:
parent
6aa688c62e
commit
1931a7efd8
6
.github/workflows/gh-pages.yml
vendored
6
.github/workflows/gh-pages.yml
vendored
@ -14,9 +14,9 @@ jobs:
|
|||||||
fetch-depth: 1
|
fetch-depth: 1
|
||||||
lfs: false
|
lfs: false
|
||||||
# pull from custom Hugo Extended image with opinionated changes
|
# pull from custom Hugo Extended image with opinionated changes
|
||||||
# Docker hub: https://hub.docker.com/r/jakejarvis/hugo-jarv.is
|
# Docker hub: https://hub.docker.com/r/jakejarvis/hugo-custom
|
||||||
# base Dockerfile source: https://go.jarv.is/30KA6DS
|
# base Dockerfile source: https://go.jarv.is/hugo-dockerfile
|
||||||
- uses: docker://jakejarvis/hugo-jarv.is:v0.53-DEV
|
- uses: docker://jakejarvis/hugo-custom:latest
|
||||||
with:
|
with:
|
||||||
args: --gc --cleanDestinationDir
|
args: --gc --cleanDestinationDir
|
||||||
- uses: jakejarvis/github-pages-deploy-action@master
|
- uses: jakejarvis/github-pages-deploy-action@master
|
||||||
|
49
Dockerfile
49
Dockerfile
@ -1,54 +1,13 @@
|
|||||||
# Custom Hugo Extended fork, pre-built on Docker Hub:
|
# Custom Hugo Extended fork, pre-built on Docker Hub:
|
||||||
# https://hub.docker.com/r/jakejarvis/hugo-jarv.is
|
# https://hub.docker.com/r/jakejarvis/hugo-custom
|
||||||
# Source for base Dockerfile: https://go.jarv.is/30KA6DS
|
# Base Dockerfile source: https://go.jarv.is/hugo-dockerfile
|
||||||
#
|
#
|
||||||
# Usage:
|
# Usage:
|
||||||
# docker build -t jarv.is:develop -f Dockerfile .
|
# docker build -t jarv.is:develop -f Dockerfile .
|
||||||
# docker run -v $(pwd):/src -p 1313:1313 jarv.is:develop
|
# docker run -v $(pwd):/src -p 1313:1313 jarv.is:develop
|
||||||
# ...then open http://localhost:1313 for the live-refresh server.
|
# ...then open http://localhost:1313 for the live-refresh server.
|
||||||
|
|
||||||
FROM golang:1.12-alpine AS builder
|
FROM jakejarvis/hugo-custom:latest
|
||||||
|
|
||||||
ARG HUGO_REPO=https://github.com/jakejarvis/hugo.git
|
|
||||||
# ARG HUGO_BRANCH=master
|
|
||||||
# ARG HUGO_COMMIT=a28865c
|
|
||||||
ARG HUGO_BUILD_TAGS=extended
|
|
||||||
|
|
||||||
# CGO (and gcc/g++) required to build wellington/go-libsass
|
|
||||||
ARG CGO=1
|
|
||||||
ENV CGO_ENABLED=${CGO}
|
|
||||||
ENV GOOS=linux
|
|
||||||
ENV GO111MODULE=on
|
|
||||||
|
|
||||||
RUN apk update && \
|
|
||||||
apk add --no-cache git gcc g++ musl-dev && \
|
|
||||||
git clone $HUGO_REPO $GOPATH/src/github.com/gohugoio/hugo && \
|
|
||||||
cd $GOPATH/src/github.com/gohugoio/hugo && \
|
|
||||||
if [ ! -z "$HUGO_BRANCH" ]; then git checkout $HUGO_BRANCH; fi && \
|
|
||||||
if [ ! -z "$HUGO_COMMIT" ]; then git reset --hard $HUGO_COMMIT; fi && \
|
|
||||||
go get github.com/magefile/mage && \
|
|
||||||
mage hugo && mage install && \
|
|
||||||
rm -rf $GOPATH/src
|
|
||||||
|
|
||||||
# verify we've built correctly
|
|
||||||
RUN /go/bin/hugo version
|
|
||||||
|
|
||||||
# ---
|
|
||||||
|
|
||||||
FROM alpine:3.10
|
|
||||||
|
|
||||||
COPY --from=builder /go/bin/hugo /usr/bin/hugo
|
|
||||||
|
|
||||||
# install libc6-compat & libstdc++ since we're building extended Hugo
|
|
||||||
# https://gitlab.com/yaegashi/hugo/commit/22f0d5cbd6114210ba7835468facbdee60609aa2
|
|
||||||
# Twitter oEmbed shortcode fails without ca-certificates (x509: certificate signed by unknown authority)
|
|
||||||
# https://github.com/google/go-github/issues/1049
|
|
||||||
RUN apk update && \
|
|
||||||
apk add --no-cache ca-certificates libc6-compat libstdc++ && \
|
|
||||||
update-ca-certificates
|
|
||||||
|
|
||||||
# verify we've copied correctly
|
|
||||||
RUN /usr/bin/hugo version
|
|
||||||
|
|
||||||
# add site source as volume
|
# add site source as volume
|
||||||
VOLUME /src
|
VOLUME /src
|
||||||
@ -58,6 +17,4 @@ WORKDIR /src
|
|||||||
EXPOSE 1313
|
EXPOSE 1313
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/bin/hugo"]
|
ENTRYPOINT ["/usr/bin/hugo"]
|
||||||
|
|
||||||
# remove before pushing to Docker Hub:
|
|
||||||
CMD ["server", "--bind", "0.0.0.0", "--port", "1313"]
|
CMD ["server", "--bind", "0.0.0.0", "--port", "1313"]
|
||||||
|
@ -14,7 +14,7 @@ I keep an ongoing list of [blog post ideas](https://github.com/jakejarvis/jarv.i
|
|||||||
|
|
||||||
## Running a local testing server with Docker
|
## Running a local testing server with Docker
|
||||||
|
|
||||||
This site runs a [custom version](https://github.com/jakejarvis/hugo) of [Hugo Extended](https://github.com/gohugoio/hugo) with a few (very opinionated) changes. To ensure consistency, the [`Dockerfile`](Dockerfile) in this repository will build my Hugo fork (forked from `v0.53-DEV`, [gohugo/hugo@`a28865c`](https://github.com/gohugoio/hugo/tree/a28865cfc3e296cf0ddd0bd6c1368fcdb2154d0f)) and run a live testing server.
|
This site runs a [custom version](https://github.com/jakejarvis/hugo-custom) of [Hugo Extended](https://github.com/gohugoio/hugo) with a few (very opinionated) changes. To ensure consistency, the [`Dockerfile`](Dockerfile) in this repository will pull my Hugo [fork](https://github.com/jakejarvis/hugo-custom) (forked from `v0.53-DEV`, [gohugo/hugo@`a28865c`](https://github.com/gohugoio/hugo/tree/a28865cfc3e296cf0ddd0bd6c1368fcdb2154d0f) and pre-built [on Docker Hub](https://hub.docker.com/r/jakejarvis/hugo-custom)) and run a live testing server.
|
||||||
|
|
||||||
Run these commands on the root of this repository:
|
Run these commands on the root of this repository:
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user