Sign inSign up

backplane/hugo

By backplane

Updated about 15 hours ago

distroless/cc-based dockerization of hugo-extended -- the static site generator

Image
0

10K+

backplane/hugo repository overview

hugo

distroless/cc-based dockerization of hugo-extended -- the static site generator

I use it as a builder in multi-stage image builds, I also run it interactively during development.

The source code for this image is hosted on GitHub in the backplane/conex repo.

Usage

Interactive

This shell function demonstrates using this container image in place of having the actual hugo binary.

hugo() {
  insert=""
  if [ "$1" = "server" ] || [ "$1" = "serve" ]; then
    shift;
    insert="server --bind 0.0.0.0 --port 1313"
  fi

  # shellcheck disable=SC2086
  docker run \
    --rm \
    --interactive \
    --tty \
    --volume "$(pwd):/work" \
    --publish "1313:1313" \
    backplane/hugo \
    hugo \
      $insert \
      "$@"
}

You just add the above function to your shell rc file then use hugo normally:

$ hugo

or

$ hugo serve -D
As Build Stage
FROM backplane/hugo as builder

COPY . .
RUN hugo

FROM nginx:1-alpine as server
COPY --from=builder /work/public/ /usr/share/nginx/html/

Tag summary

Content type

Image

Digest

sha256:9f08bd3a3

Size

39.6 MB

Last updated

about 15 hours ago

docker pull backplane/hugo