@@ -8,11 +8,10 @@ ARG GO_VERSION=1.23
8
8
# HTMLTEST_VERSION sets the wjdp/htmltest version for HTML testing
9
9
ARG HTMLTEST_VERSION=0.17.0
10
10
# 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
12
12
13
13
# build-base is the base stage used for building the site
14
14
FROM ghcr.io/gohugoio/hugo:v${HUGO_VERSION} AS build-base
15
- USER root
16
15
ENV NODE_ENV="production"
17
16
RUN --mount=source=package.json,target=package.json \
18
17
--mount=source=package-lock.json,target=package-lock.json \
@@ -26,8 +25,7 @@ FROM build-base AS build
26
25
ARG HUGO_ENV="development"
27
26
# DOCS_URL sets the base URL for the site
28
27
ARG DOCS_URL="https://docs.docker.com"
29
- RUN --mount=type=cache,target=/cache \
30
- hugo --gc --minify -d /out -e $HUGO_ENV -b $DOCS_URL
28
+ RUN hugo --gc --minify -e $HUGO_ENV -b $DOCS_URL
31
29
32
30
# lint lints markdown files
33
31
FROM davidanson/markdownlint-cli2:v0.14.0 AS lint
@@ -41,7 +39,7 @@ RUN --mount=type=bind,target=. \
41
39
# test validates HTML output and checks for broken links
42
40
FROM wjdp/htmltest:v${HTMLTEST_VERSION} AS test
43
41
WORKDIR /test
44
- COPY --from=build /out ./public
42
+ COPY --from=build /project/public ./public
45
43
ADD .htmltest.yml .htmltest.yml
46
44
RUN htmltest
47
45
@@ -76,12 +74,12 @@ ARG UPSTREAM_REPO
76
74
ARG UPSTREAM_COMMIT
77
75
# HUGO_MODULE_REPLACEMENTS is the replacement module for the upstream project
78
76
ENV 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
77
+ RUN hugo --ignoreVendorPaths "github.com/${UPSTREAM_MODULE_NAME}"
80
78
81
79
# validate-upstream validates HTML output for upstream builds
82
80
FROM wjdp/htmltest:v${HTMLTEST_VERSION} AS validate-upstream
83
81
WORKDIR /test
84
- COPY --from=build-upstream /out ./public
82
+ COPY --from=build-upstream /project/public ./public
85
83
ADD .htmltest.yml .htmltest.yml
86
84
RUN htmltest
87
85
96
94
97
95
# path-warnings checks for duplicate target paths
98
96
FROM build-base AS path-warnings
99
- RUN hugo --printPathWarnings > /path-warnings.txt
97
+ RUN hugo --printPathWarnings > . /path-warnings.txt
100
98
RUN <<EOT
101
- DUPLICATE_TARGETS=$(grep "Duplicate target paths" /path-warnings.txt)
99
+ DUPLICATE_TARGETS=$(grep "Duplicate target paths" . /path-warnings.txt)
102
100
if [ ! -z "$DUPLICATE_TARGETS" ]; then
103
101
echo "$DUPLICATE_TARGETS"
104
102
echo "You probably have a duplicate alias defined. Please check your aliases."
109
107
# pagefind installs the Pagefind runtime
110
108
FROM node:alpine${ALPINE_VERSION} AS pagefind
111
109
ARG PAGEFIND_VERSION=1.1.1
112
- COPY --from=build /out ./public
110
+ COPY --from=build /project/public ./public
113
111
RUN --mount=type=bind,src=pagefind.yml,target=pagefind.yml \
114
112
npx pagefind@v${PAGEFIND_VERSION} --output-path "/pagefind"
115
113
@@ -121,13 +119,13 @@ COPY --from=pagefind /pagefind .
121
119
FROM alpine:${ALPINE_VERSION} AS test-go-redirects
122
120
WORKDIR /work
123
121
RUN apk add yq
124
- COPY --from=build /out ./public
122
+ COPY --from=build /project/public ./public
125
123
RUN --mount=type=bind,target=. <<"EOT"
126
124
set -ex
127
125
./scripts/test_go_redirects.sh
128
126
EOT
129
127
130
128
# release is an empty scratch image with only compiled assets
131
129
FROM scratch AS release
132
- COPY --from=build /out /
130
+ COPY --from=build /project/public /
133
131
COPY --from=pagefind /pagefind /pagefind
0 commit comments