Skip to content

Use pre-build docker image in .gitlab-ci.yml

username-removed-1546806 requested to merge PMudra/hugo:master into master

Firstly, I am not quite sure if this merge requests fits the intention of this repository. So feel free to comment and close it.

I have build an automated docker image build for hugo based on the alpine image. See this Repository.

The Dockerfile looks like this:

FROM alpine:3.6

ENV HUGO_VERSION 0.26
ENV HUGO_SHA 67e4ba5ec2a02c8164b6846e30a17cc765b0165a5b183d5e480149baf54e1a50

RUN set -eux; \
        apk update; \
        apk add --no-cache --virtual .fetch-deps \
		    ca-certificates \
		    openssl; \
        wget -O hugo.tar.gz "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_Linux-64bit.tar.gz"; \
        echo "${HUGO_SHA} *hugo.tar.gz" | sha256sum -c -; \
        tar -C /usr/local/bin -xf hugo.tar.gz hugo; \
        rm hugo.tar.gz; \
        apk del .fetch-deps; \
        hugo version

EXPOSE 1313

CMD ["/usr/local/bin/hugo"]

It basically does the same thing as you do in the gitlab-ci.yml. So the benefit of this merge request is the removing of cluttering. And the build should be a little faster. Additionally, this repository would use the latest versions of hugo.

If you do not want to add this to your original gitlab-ci.yml I could create another merge request where I add mine as additional documentation.

Merge request reports