@@ -8,11 +8,10 @@ ARG GO_VERSION=1.23
88# HTMLTEST_VERSION sets the wjdp/htmltest version for HTML testing
99ARG HTMLTEST_VERSION=0.17.0
1010# HUGO_VERSION sets the version of Hugo to build the site with
11- ARG HUGO_VERSION=0.136.2
11+ ARG HUGO_VERSION=0.136.3
1212
1313# build-base is the base stage used for building the site
1414FROM ghcr.io/gohugoio/hugo:v${HUGO_VERSION} AS build-base
15- USER root
1615ENV NODE_ENV="production"
1716RUN --mount=source=package.json,target=package.json \
1817 --mount=source=package-lock.json,target=package-lock.json \
@@ -27,7 +26,7 @@ ARG HUGO_ENV="development"
2726# DOCS_URL sets the base URL for the site
2827ARG DOCS_URL="https://docs.docker.com"
2928RUN --mount=type=cache,target=/cache \
30- hugo --gc --minify -d /out - e $HUGO_ENV -b $DOCS_URL
29+ hugo --gc --minify -e $HUGO_ENV -b $DOCS_URL
3130
3231# lint lints markdown files
3332FROM davidanson/markdownlint-cli2:v0.14.0 AS lint
@@ -41,7 +40,7 @@ RUN --mount=type=bind,target=. \
4140# test validates HTML output and checks for broken links
4241FROM wjdp/htmltest:v${HTMLTEST_VERSION} AS test
4342WORKDIR /test
44- COPY --from=build /out ./public
43+ COPY --from=build /project/public ./public
4544ADD .htmltest.yml .htmltest.yml
4645RUN htmltest
4746
@@ -76,12 +75,12 @@ ARG UPSTREAM_REPO
7675ARG UPSTREAM_COMMIT
7776# HUGO_MODULE_REPLACEMENTS is the replacement module for the upstream project
7877ENV HUGO_MODULE_REPLACEMENTS="github.com/${UPSTREAM_MODULE_NAME} -> github.com/${UPSTREAM_REPO} ${UPSTREAM_COMMIT}"
79- RUN hugo --ignoreVendorPaths "github.com/${UPSTREAM_MODULE_NAME}" -d /out
78+ RUN hugo --ignoreVendorPaths "github.com/${UPSTREAM_MODULE_NAME}"
8079
8180# validate-upstream validates HTML output for upstream builds
8281FROM wjdp/htmltest:v${HTMLTEST_VERSION} AS validate-upstream
8382WORKDIR /test
84- COPY --from=build-upstream /out ./public
83+ COPY --from=build-upstream /project/public ./public
8584ADD .htmltest.yml .htmltest.yml
8685RUN htmltest
8786
9695
9796# path-warnings checks for duplicate target paths
9897FROM build-base AS path-warnings
99- RUN hugo --printPathWarnings > /path-warnings.txt
98+ RUN hugo --printPathWarnings > . /path-warnings.txt
10099RUN <<EOT
101- DUPLICATE_TARGETS=$(grep "Duplicate target paths" /path-warnings.txt)
100+ DUPLICATE_TARGETS=$(grep "Duplicate target paths" . /path-warnings.txt)
102101if [ ! -z "$DUPLICATE_TARGETS" ]; then
103102 echo "$DUPLICATE_TARGETS"
104103 echo "You probably have a duplicate alias defined. Please check your aliases."
109108# pagefind installs the Pagefind runtime
110109FROM node:alpine${ALPINE_VERSION} AS pagefind
111110ARG PAGEFIND_VERSION=1.1.1
112- COPY --from=build /out ./public
111+ COPY --from=build /project/public ./public
113112RUN --mount=type=bind,src=pagefind.yml,target=pagefind.yml \
114113 npx pagefind@v${PAGEFIND_VERSION} --output-path "/pagefind"
115114
@@ -121,13 +120,13 @@ COPY --from=pagefind /pagefind .
121120FROM alpine:${ALPINE_VERSION} AS test-go-redirects
122121WORKDIR /work
123122RUN apk add yq
124- COPY --from=build /out ./public
123+ COPY --from=build /project/public ./public
125124RUN --mount=type=bind,target=. <<"EOT"
126125set -ex
127126./scripts/test_go_redirects.sh
128127EOT
129128
130129# release is an empty scratch image with only compiled assets
131130FROM scratch AS release
132- COPY --from=build /out /
131+ COPY --from=build /project/public /
133132COPY --from=pagefind /pagefind /pagefind
0 commit comments