From 348e08322793ae60fbfe119e069a962baf4dcda2 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 16 Oct 2024 21:03:27 +0200 Subject: [PATCH] unecessary container image layer duplication container images grew by 100MB when RUN ln /app/gitea/gitea /app/gitea/forgejo-cli was added because hard links are not preserved. Use symbolic links instead. https://tauri.earth/@AliveDevil/113318561067465279 (cherry picked from commit 7d779a7859834d42d2feddb247e1a6e1346e720c) --- Dockerfile | 2 +- Dockerfile.rootless | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 01ab36b711..668a5da25e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -103,6 +103,6 @@ CMD ["/bin/s6-svscan", "/etc/s6"] COPY --from=build-env /tmp/local / RUN cd /usr/local/bin ; ln -s gitea forgejo COPY --from=build-env /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea -RUN ln /app/gitea/gitea /app/gitea/forgejo-cli +RUN ln -s /app/gitea/gitea /app/gitea/forgejo-cli COPY --from=build-env /go/src/code.gitea.io/gitea/environment-to-ini /usr/local/bin/environment-to-ini COPY --from=build-env /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete /etc/profile.d/gitea_bash_autocomplete.sh diff --git a/Dockerfile.rootless b/Dockerfile.rootless index d2f5f71524..32d4966535 100644 --- a/Dockerfile.rootless +++ b/Dockerfile.rootless @@ -90,7 +90,7 @@ RUN chown git:git /var/lib/gitea /etc/gitea COPY --from=build-env /tmp/local / RUN cd /usr/local/bin ; ln -s gitea forgejo COPY --from=build-env --chown=root:root /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea -RUN ln /app/gitea/gitea /app/gitea/forgejo-cli +RUN ln -s /app/gitea/gitea /app/gitea/forgejo-cli COPY --from=build-env --chown=root:root /go/src/code.gitea.io/gitea/environment-to-ini /usr/local/bin/environment-to-ini COPY --from=build-env /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete /etc/profile.d/gitea_bash_autocomplete.sh