After Update to Release 0.54 error to build the image on Dockerhub

I want to update my Docker image to Release 0.54. The Dockerfile worked for the Releases 0.48 - 0.53.

I got this error:

Step 4/13 : ENV HUGO_VERSION 0.54
---> Running in 0d9053306338
Removing intermediate container 0d9053306338
---> 3e4007bc75df
Step 5/13 : ENV HUGO_BINARY hugo_${HUGO_VERSION}_Linux-64bit.deb
---> Running in e5635f53bdeb
Removing intermediate container e5635f53bdeb
---> 7260b69a3baf
Step 6/13 : RUN curl -sL -o /tmp/hugo.deb https://github.com/spf13/hugo/releases/download/v${HUGO_VERSION}/${HUGO_BINARY} && dpkg -i /tmp/hugo.deb && rm /tmp/hugo.deb
---> Running in e6340b8c47c2
dpkg-deb: error: '/tmp/hugo.deb' is not a debian format archive
dpkg: error processing archive /tmp/hugo.deb (--install):
subprocess dpkg-deb --control returned error exit status 2
Errors were encountered while processing:
/tmp/hugo.deb
Removing intermediate container e6340b8c47c2
The command '/bin/sh -c curl -sL -o /tmp/hugo.deb https://github.com/spf13/hugo/releases/download/v${HUGO_VERSION}/${HUGO_BINARY} && dpkg -i /tmp/hugo.deb && rm /tmp/hugo.deb' returned a non-zero code: 1

Here is my Dockerfile

FROM debian:stable

Label J <user@example.com>

# Install pygments (for syntax highlighting)
RUN apt-get -qq update \
    && DEBIAN_FRONTEND=noninteractive apt-get -q install -y --no-install-recommends python-pygments git ca-certificates asciidoc curl \
    && rm -rf /var/lib/apt/lists/*

# Download and install hugo
ENV HUGO_VERSION 0.54
ENV HUGO_BINARY hugo_${HUGO_VERSION}_Linux-64bit.deb

RUN curl -sL -o /tmp/hugo.deb \
    https://github.com/spf13/hugo/releases/download/v${HUGO_VERSION}/${HUGO_BINARY} \
    && dpkg -i /tmp/hugo.deb \
    && rm /tmp/hugo.deb

# Create working directory
RUN mkdir /usr/share/blog
WORKDIR /usr/share/blog

# Expose default hugo port
EXPOSE 1313

# Automatically build site
ONBUILD ADD site/ /usr/share/blog
ONBUILD RUN hugo -d /usr/share/nginx/html/

# By default, serve site
ENV HUGO_BASE_URL http://localhost:1313
CMD hugo server -b ${HUGO_BASE_URL} --bind=0.0.0.0

Just a wild guess, but try setting your HUGO_VERSION to 0.54.0 (notice the trailing zero)

Thank you for your tip. It works. But I don’t understand why it works until Version number 0.53?

See https://github.com/gohugoio/hugo/issues/5639 for the whole conversation