Browse Source

build(feature/extended-builds): upgrade extended build to hugo@0.60.0, go@1.13.4 and alpine@3.10

pull/198/head
Josh Habdas 1 year ago
parent
commit
b229f2be22
Signed by: jhabdas GPG Key ID: B148B31154C75A74
5 changed files with 16 additions and 16 deletions
  1. +6
    -6
      Dockerfile
  2. +1
    -1
      docker-compose.yml
  3. +5
    -5
      docker/hugo/Dockerfile
  4. +2
    -2
      docs/content/feature/extended-builds.id.md
  5. +2
    -2
      docs/content/feature/extended-builds.md

+ 6
- 6
Dockerfile View File

@ -17,17 +17,17 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
# DOCKER-VERSION 19.03.1-ce, build 74b1e89e8a
# DOCKER-VERSION 19.03.5, build 633a0ea
# Specify build image
ARG GO_VERSION=1.11.4
ARG BUILD_TARGET=alpine3.8
ARG GO_VERSION=1.13.4
ARG BUILD_TARGET=alpine3.10
# Pull builder base image
FROM golang:${GO_VERSION}-${BUILD_TARGET} AS hugobuilder
# Set hugo environment variables
ENV HUGO_VERSION=0.57.0 \
ENV HUGO_VERSION=0.60.0 \
CGO_ENABLED=1 \
GOOS=linux \
GO111MODULE=on \
@ -35,7 +35,7 @@ ENV HUGO_VERSION=0.57.0 \
# Build hugo from source using specified version
RUN \
apk add --update --no-cache git gcc g++ binutils musl-dev && \
apk add --update --no-cache git gcc g++ && \
git clone https://github.com/gohugoio/hugo.git $GOPATH/src/github.com/gohugoio/hugo && \
cd ${GOPATH:-$HOME/go}/src/github.com/gohugoio/hugo && \
git checkout v$HUGO_VERSION && \
@ -53,4 +53,4 @@ EXPOSE 80
COPY --from=hugobuilder /go/bin/hugo /usr/local/bin/hugo
COPY --from=sitebuilder /tmp/flying-toasters/ /opt/after-dark/
ENTRYPOINT ["/usr/local/bin/hugo"]
CMD ["serve","--buildDrafts","--bind","0.0.0.0","--port","80","--source","/opt/after-dark","--destination","/var/www"]
CMD ["serve","--buildDrafts","--bind","0.0.0.0","--port","80","--source","/opt/after-dark","--destination","/var/www"]

+ 1
- 1
docker-compose.yml View File

@ -22,7 +22,7 @@
# HOW TO USE THIS FILE
#
# 1. Install Docker and Docker Compose on a host
# 1. Install Docker and Docker Compose on a host machine
# 2. Copy `Dockerfile` and `docker-compose.yml` to directory of choice
# 3. Run `docker build .` to build after-dark image
# 4. Run `mkdir -p site/content` to contain your config and site content

+ 5
- 5
docker/hugo/Dockerfile View File

@ -17,17 +17,17 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
# DOCKER-VERSION 19.03.1-ce, build 74b1e89e8a
# DOCKER-VERSION 19.03.5, build 633a0ea
# Specify build image
ARG GO_VERSION=1.11.4
ARG BUILD_TARGET=alpine3.8
ARG GO_VERSION=1.13.4
ARG BUILD_TARGET=alpine3.10
# Pull builder base image
FROM golang:${GO_VERSION}-${BUILD_TARGET} AS hugobuilder
# Set environment variables
ENV HUGO_VERSION=0.57.0 \
ENV HUGO_VERSION=0.60.0 \
CGO_ENABLED=1 \
GOOS=linux \
GO111MODULE=on \
@ -35,7 +35,7 @@ ENV HUGO_VERSION=0.57.0 \
# Build from source using specified version
RUN \
apk add --update --no-cache git gcc g++ binutils musl-dev && \
apk add --update --no-cache git gcc g++ && \
git clone https://github.com/gohugoio/hugo.git $GOPATH/src/github.com/gohugoio/hugo && \
cd ${GOPATH:-$HOME/go}/src/github.com/gohugoio/hugo && \
git checkout v$HUGO_VERSION && \

+ 2
- 2
docs/content/feature/extended-builds.id.md View File

@ -2,7 +2,7 @@
title = "Extended Builds"
description = "Build Hugo with Sass and Go CDK Deploy support."
categories = ["core"]
tags = ["docker", "container", "sass", "cloud"]
tags = ["docker", "container", "sass", "cloud", "ci"]
features = ["code highlighter", "related content"]
[[copyright]]
owner = "Josh Habdas"
@ -31,7 +31,7 @@ Where `f2b785583ce8` is the scratch container's Image ID and `/usr/local/bin` is
For builds without Sass support enabled turn off `CGO_ENABLED`, pass in a phony value to `BUILD_TAGS`, create another build and give it a docker tag:
```sh
docker tag $(docker images -q | head -n 1) gohugoio/hugo:v0.57.0
docker tag $(docker images -q | head -n 1) gohugoio/hugo:v0.60.0
```
It's recommended at least 2GB of storage space is available when running builds. The resulting binary inside the scratch container is less than 50MB.

+ 2
- 2
docs/content/feature/extended-builds.md View File

@ -15,7 +15,7 @@ After Dark ships with the ability to build Hugo from tagged-version source. Supp
To use install Docker then run the following command:
```sh
cd after-dark/docker/hugo && docker build --rm .
cd after-dark/docker/hugo && docker build .
```
Build container uses Alpine and includes `musl-dev` for high-performance. Update the `HUGO_VERSION` to get a specific Hugo release built. Upon successful build extract the resulting `hugo` binary out of the scratch container like:
@ -31,7 +31,7 @@ Where `f2b785583ce8` is the scratch container's Image ID and `/usr/local/bin` is
For builds without Sass support enabled turn off `CGO_ENABLED`, pass in a phony value to `BUILD_TAGS`, create another build and give it a docker tag:
```sh
docker tag $(docker images -q | head -n 1) gohugoio/hugo:v0.57.0
docker tag $(docker images -q | head -n 1) gohugoio/hugo:v0.60.0
```
It's recommended at least 2GB of storage space is available when running builds. The resulting binary inside the scratch container is less than 50MB.

Loading…
Cancel
Save