summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEarl Warren <contact@earl-warren.org>2024-10-16 21:03:27 +0200
committerEarl Warren <contact@earl-warren.org>2024-10-16 21:07:22 +0200
commit7d779a7859834d42d2feddb247e1a6e1346e720c (patch)
tree0d917986fdcd7851d35539e0e1421d5a182eed5c
parentMerge pull request 'docs: add link to the v9.0.0 release notes' (#5391) from ... (diff)
downloadforgejo-7d779a7859834d42d2feddb247e1a6e1346e720c.tar.xz
forgejo-7d779a7859834d42d2feddb247e1a6e1346e720c.zip
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
-rw-r--r--Dockerfile2
-rw-r--r--Dockerfile.rootless2
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