Closed Timmy1e closed 4 months ago
hi @Timmy1e ,
Just tested the onbuild on my side using the latest onbuild image and all is working as expected.
Could you please take a look here: https://github.com/floryn90/docker-hugo?tab=readme-ov-file#using-onbuild-image
Also, if possible, could you please share your full dockerfile that you're using to build the website?
This is the Dockerfile for my project. I originally saw this issue on the Gitlab CI for my project.
I just tried it locally, where it didn't print this warning, but it also didn't add the Git info.
Locally I'm using Docker 25.0.3
with Buildx 0.12.1
.
On Gitlab CI it's using the Docker latest
tag.
# Stage 1, build using automated build
FROM docker.io/floryn90/hugo:ext-alpine-onbuild AS build
ENV HUGO_CMD="--minify --enableGitInfo --verbose"
ENV HUGO_ENV_ARG="production"
# Manually install Git?
#RUN apk add --no-cache git
# Stage 2, final
FROM docker.io/nginx:mainline-alpine as final
# Set the work dir
WORKDIR /usr/share/nginx/html/
# Clean the default public folder
RUN rm -fr * .??*
# NGINX configuration
COPY .docker/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
# Finally, copy the "target" folder generated by Hugo in the previous stage into the public fold of Nginx
COPY --from=build /target /usr/share/nginx/html
So after a bunch of testing and Googling, it's a known issue that Docker in Gitlab CI just sort of prints that message. I also had my theme misconfigured so the Git features weren't showing up.
So the Gitlab CI log lead me down the wrong trail, and there is nothing wrong with the tags. My apologies. I'm closing this issue.
I have the following Docker build stage:
The site builds successfully, but it doesn't enable Git info.
I've tried manually adding Git.
Either way Hugo throws the following warning: