Split Debian and Alpine into different build matrix
This starts building both Debian and Alpine based images at the same time
Make use of Docker BuildKit, which improves speed also.
Use BuildKit caching for Rust Cargo across docker images.
This prevents downloading the same crates multiple times.
Use Github Actions Services to start a docker registry, starting it
via the build script sometimes caused issues.
Updated the Build workflow to use Ubuntu 20.04 which is more close to
the Bullseye Debian release regarding package versions.
As a side-note, i also tried adding the apt files to the cache, it did not cause any change into the build-time (both local and on GHA) so to have less complexity i did not add it.
🔄 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/1973
**Author:** [@BlackDex](https://github.com/BlackDex)
**Created:** 9/13/2021
**Status:** ✅ Merged
**Merged:** 9/13/2021
**Merged by:** [@dani-garcia](https://github.com/dani-garcia)
**Base:** `main` ← **Head:** `optimize-release`
---
### 📝 Commits (1)
- [`ca0fd7a`](https://github.com/dani-garcia/vaultwarden/commit/ca0fd7a31b724d06ba4eca203bfeda9e38c5e767) Optimize release workflow.
### 📊 Changes
**19 files changed** (+1170 additions, -193 deletions)
<details>
<summary>View changed files</summary>
📝 `.github/workflows/build.yml` (+12 -33)
📝 `.github/workflows/hadolint.yml` (+1 -1)
📝 `.github/workflows/release.yml` (+21 -7)
📝 `docker/Dockerfile.j2` (+65 -44)
📝 `docker/Makefile` (+6 -0)
📝 `docker/amd64/Dockerfile` (+19 -7)
📝 `docker/amd64/Dockerfile.alpine` (+12 -4)
➕ `docker/amd64/Dockerfile.buildx` (+126 -0)
➕ `docker/amd64/Dockerfile.buildx.alpine` (+118 -0)
📝 `docker/arm64/Dockerfile` (+45 -30)
➕ `docker/arm64/Dockerfile.buildx` (+169 -0)
📝 `docker/armv6/Dockerfile` (+45 -30)
➕ `docker/armv6/Dockerfile.buildx` (+169 -0)
📝 `docker/armv7/Dockerfile` (+45 -30)
📝 `docker/armv7/Dockerfile.alpine` (+12 -4)
➕ `docker/armv7/Dockerfile.buildx` (+169 -0)
➕ `docker/armv7/Dockerfile.buildx.alpine` (+125 -0)
📝 `hooks/build` (+6 -1)
📝 `hooks/push` (+5 -2)
</details>
### 📄 Description
- Split Debian and Alpine into different build matrix
This starts building both Debian and Alpine based images at the same time
- Make use of Docker BuildKit, which improves speed also.
- Use BuildKit caching for Rust Cargo across docker images.
This prevents downloading the same crates multiple times.
- Use Github Actions Services to start a docker registry, starting it
via the build script sometimes caused issues.
- Updated the Build workflow to use Ubuntu 20.04 which is more close to
the Bullseye Debian release regarding package versions.
As a side-note, i also tried adding the apt files to the cache, it did not cause any change into the build-time (both local and on GHA) so to have less complexity i did not add it.
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/dani-garcia/vaultwarden/pull/1973
Author: @BlackDex
Created: 9/13/2021
Status: ✅ Merged
Merged: 9/13/2021
Merged by: @dani-garcia
Base:
main← Head:optimize-release📝 Commits (1)
ca0fd7aOptimize release workflow.📊 Changes
19 files changed (+1170 additions, -193 deletions)
View changed files
📝
.github/workflows/build.yml(+12 -33)📝
.github/workflows/hadolint.yml(+1 -1)📝
.github/workflows/release.yml(+21 -7)📝
docker/Dockerfile.j2(+65 -44)📝
docker/Makefile(+6 -0)📝
docker/amd64/Dockerfile(+19 -7)📝
docker/amd64/Dockerfile.alpine(+12 -4)➕
docker/amd64/Dockerfile.buildx(+126 -0)➕
docker/amd64/Dockerfile.buildx.alpine(+118 -0)📝
docker/arm64/Dockerfile(+45 -30)➕
docker/arm64/Dockerfile.buildx(+169 -0)📝
docker/armv6/Dockerfile(+45 -30)➕
docker/armv6/Dockerfile.buildx(+169 -0)📝
docker/armv7/Dockerfile(+45 -30)📝
docker/armv7/Dockerfile.alpine(+12 -4)➕
docker/armv7/Dockerfile.buildx(+169 -0)➕
docker/armv7/Dockerfile.buildx.alpine(+125 -0)📝
hooks/build(+6 -1)📝
hooks/push(+5 -2)📄 Description
This starts building both Debian and Alpine based images at the same time
This prevents downloading the same crates multiple times.
via the build script sometimes caused issues.
the Bullseye Debian release regarding package versions.
As a side-note, i also tried adding the apt files to the cache, it did not cause any change into the build-time (both local and on GHA) so to have less complexity i did not add it.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.