From 07d410de21d8795a05d4d623f1063efbbc48a668 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sun, 15 Mar 2020 18:25:30 +0100 Subject: [PATCH] Dockerfile: fix links in same step as generating the files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 3 minutes ago RUN /bin/sh -c jekyll build -d ${TARGET} # b… 375MB buildkit.dockerfile.v0 Signed-off-by: Sebastiaan van Stijn --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 71001c918f..1e4a008b05 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 # API docs, based on the latest_engine_api_version parameter in _config.yml RUN ./_scripts/update-api-toc.sh -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 +RUN jekyll build -d ${TARGET} \ + && 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