mirror of https://github.com/docker/docs.git
Dockerfile: fix links in same step as generating the files
For intermediate stages, it's generally ok to perform steps
separately, however in this case, fixing the links would
happen every time the HTML was generated, so we might as
well do it in the same step, to reduce the size of the local
build cache, as it was adding 54MB for each rebuild:
IMAGE CREATED CREATED BY SIZE COMMENT
7d97d86ae290 3 minutes ago RUN /bin/sh -c find ${TARGET} -type f -name … 53.7MB buildkit.dockerfile.v0
<missing> 3 minutes ago RUN /bin/sh -c jekyll build -d ${TARGET} # b… 375MB buildkit.dockerfile.v0
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
a5ab6fa4f8
commit
07d410de21
|
|
@ -71,8 +71,8 @@ COPY --from=upstream-resources /usr/src/app/md_source/. ./
|
||||||
# substitute the "{site.latest_engine_api_version}" in the title for the latest
|
# substitute the "{site.latest_engine_api_version}" in the title for the latest
|
||||||
# API docs, based on the latest_engine_api_version parameter in _config.yml
|
# API docs, based on the latest_engine_api_version parameter in _config.yml
|
||||||
RUN ./_scripts/update-api-toc.sh
|
RUN ./_scripts/update-api-toc.sh
|
||||||
RUN jekyll build -d ${TARGET}
|
RUN jekyll build -d ${TARGET} \
|
||||||
RUN find ${TARGET} -type f -name '*.html' | grep -vE "v[0-9]+\." | while read i; do sed -i 's#href="https://docs.docker.com/#href="/#g' "$i"; done
|
&& find ${TARGET} -type f -name '*.html' | grep -vE "v[0-9]+\." | while read i; do sed -i 's#href="https://docs.docker.com/#href="/#g' "$i"; done
|
||||||
|
|
||||||
|
|
||||||
# This stage only contains the generated files. It can be used to host the
|
# This stage only contains the generated files. It can be used to host the
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue