From 2d4ee1c9f8015fa8b64cab88ea2254755d59b919 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Domeradzki?= Date: Thu, 21 Nov 2024 22:33:32 +0100 Subject: [PATCH] Improve COPY in our dockerfiles https://docs.docker.com/reference/dockerfile/#copy---link > If you don't rely on the behavior of following symlinks in the destination path, using --link is always recommended. The performance of --link is equivalent or better than the default behavior and, it creates much better conditions for cache reuse. Also recommended in aspnet samples: https://github.com/dotnet/dotnet-docker/blob/main/samples/aspnetapp/Dockerfile --- Dockerfile | 26 +++++++++++++------------- Dockerfile.Service | 26 +++++++++++++------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/Dockerfile b/Dockerfile index 305834f84..eede76848 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,8 +2,8 @@ ARG IMAGESUFFIX FROM --platform=$BUILDPLATFORM node:lts${IMAGESUFFIX} AS build-node WORKDIR /app/ASF-ui -COPY ASF-ui . -COPY .git/modules/ASF-ui /app/.git/modules/ASF-ui +COPY --link ASF-ui . +COPY --link .git/modules/ASF-ui /app/.git/modules/ASF-ui RUN <