[PR #4532] [MERGED] Optimize Dockerfiles #7088

Closed
opened 2026-03-07 21:10:48 -06:00 by GiteaMirror · 0 comments
Owner

📋 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: mainHead: docker-optimizations


📝 Commits (1)

📊 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.

## 📋 Pull Request Information **Original PR:** https://github.com/dani-garcia/vaultwarden/pull/4532 **Author:** [@dfunkt](https://github.com/dfunkt) **Created:** 5/1/2024 **Status:** ✅ Merged **Merged:** 5/19/2024 **Merged by:** [@dani-garcia](https://github.com/dani-garcia) **Base:** `main` ← **Head:** `docker-optimizations` --- ### 📝 Commits (1) - [`e1a5baf`](https://github.com/dani-garcia/vaultwarden/commit/e1a5baf2c937ad8235ead76a5cb0b7fcb7140b82) Optimize Dockerfiles ### 📊 Changes **3 files changed** (+44 additions, -50 deletions) <details> <summary>View changed files</summary> 📝 `docker/Dockerfile.alpine` (+11 -13) 📝 `docker/Dockerfile.debian` (+14 -17) 📝 `docker/Dockerfile.j2` (+19 -20) </details> ### 📄 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) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-07 21:10:49 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vaultwarden#7088