mirror of https://github.com/docker/docs.git
hugo: use Go toolchain to update module version
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
This commit is contained in:
parent
a4609c201d
commit
a719c2531f
14
Dockerfile
14
Dockerfile
|
@ -50,11 +50,15 @@ RUN htmltest
|
|||
|
||||
FROM build-base as update-modules
|
||||
ARG MODULE
|
||||
RUN if [ -n "$MODULE" ]; then \
|
||||
hugo mod get ${MODULE}; \
|
||||
else \
|
||||
echo "no module set"; \
|
||||
fi
|
||||
RUN <<"EOT"
|
||||
if [ -n "$MODULE" ]; then
|
||||
go mod edit -dropdreplace ${MODULE/@*/}
|
||||
hugo mod get ${MODULE}
|
||||
go mod edit -replace ${MODULE/@*/}=${MODULE};
|
||||
else \
|
||||
echo "no module set"; \
|
||||
fi
|
||||
EOT
|
||||
RUN hugo mod vendor
|
||||
|
||||
FROM scratch as vendor
|
||||
|
|
Loading…
Reference in New Issue