Hi,
I’m trying to run Hugo from a container. I mount my local file system into the container and everything builds correctly. Doing a diff of my original generated site and the one produced via the containerized Hugo, I see that all uses of Page.Lastmod return a zero date. I’m trying to figure out how to fix this.
The container includes Hugo and git. Issuing a “git status” from within the container runs correctly and gives me valid info. Hugo runs and otherwise works perfectly, so all my options in config.toml are being respected. I’m using Hugo 0.42.1. My Dockerfile is pasted below for reference.
Anybody got ideas on this?
Thanks.
------ Dockerfile
FROM ruby:2.4-alpine
RUN echo 'gem: --no-document' >> /etc/gemrc
RUN apk add --no-cache \
nodejs \
ruby \
ruby-dev \
build-base \
gcc \
libc-dev \
zlib-dev \
libxslt-dev \
libxml2-dev \
libcurl \
git \
&& apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ --allow-untrusted gnu-libiconv
ENV HUGO_VERSION=0.42.1
ADD https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_Linux-64bit.tar.gz /tmp
RUN tar -xf /tmp/hugo_${HUGO_VERSION}_Linux-64bit.tar.gz -C /tmp \
&& mkdir -p /usr/local/sbin \
&& mv /tmp/hugo /usr/local/sbin/hugo \
&& rm -rf /tmp/hugo_${HUGO_VERSION}_linux_amd64 \
&& rm -rf /tmp/hugo_${HUGO_VERSION}_Linux-64bit.tar.gz \
&& rm -rf /tmp/LICENSE.md \
&& rm -rf /tmp/README.md
RUN npm install -g \
html-minifier \
sass \
uglify-js \
markdown-spellcheck
RUN gem install \
mdl \
html-proofer
ENV PATH /usr/bin:$PATH
# TODO: replace with your ENTRYPOINT or CMD.
CMD [ "/usr/bin/ruby", "-v"]