mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-03-25 15:50:21 -05:00
[PR #4532] [MERGED] Optimize Dockerfiles #7088
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/dani-garcia/vaultwarden/pull/4532
Author: @dfunkt
Created: 5/1/2024
Status: ✅ Merged
Merged: 5/19/2024
Merged by: @dani-garcia
Base:
main← Head:docker-optimizations📝 Commits (1)
e1a5bafOptimize Dockerfiles📊 Changes
3 files changed (+44 additions, -50 deletions)
View changed files
📝
docker/Dockerfile.alpine(+11 -13)📝
docker/Dockerfile.debian(+14 -17)📝
docker/Dockerfile.j2(+19 -20)📄 Description
Move some ARGs closer to the build stage (potentially improving caching):
Example: I usually set VW_VERSION to be the latest commit hash, without this change I'd have to also rebuild the dependencies even if they didn't change since the previous layers would get invalidated.
Remove redundant COPY commands:
They can be combined, no point in using extra layers if it can be avoided.
Remove redundant RUN command:
apt-get and xx-apt-get commands can be moved into the same RUN command, thus saving another layer.
Move CARGO_HOME's "&&" operator to the first line (improves consistency)
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.