profileRyan KesPGP keyI build stuffEmailGithubTwitterLast.fmMastodonMatrix

Alpine-Hugo-Git-Bash Docker Image

I use wercker to automatically deploy this site. One of the nice things about wercker is that it allows for you use docker images in your builds. To keep build time to a minimum I've created a docker image with all the tools I need to build this site. Namely:

The Dockerfile itself is nothing shocking:

FROM alpine:latest
MAINTAINER Ryan Kes <ryan@andthensome.nl>

ENV HUGO*VERSION 0.16
ENV HUGO_BINARY hugo*\${HUGO_VERSION}\_linux-64bit

# Install pygments (for syntax highlighting)

RUN apk update && apk add py-pygments && apk add git && apk add bash && rm -rf /var/cache/apk/\*

# Download and Install hugo

ADD https://github.com/spf13/hugo/releases/download/v${HUGO_VERSION}/${HUGO_BINARY}.tgz /usr/local/
RUN tar xzf /usr/local/${HUGO_BINARY}.tgz -C /usr/local/bin/ \
	&& rm /usr/local/${HUGO_BINARY}.tgz

A comparison of image sizes & build speeds :

ImageSizeBuild Duration
nodesource/trusty62.8 MB55s
andthensome/alpine-hugo-git-bash33.4 MB29s