-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Enable reproducible container builds
Requires to use the upcoming buildkit release 0.13.0 and a number of extra parameters to build-push-action. We also need to avoid layer caches during the initial builds as those may contain wrong timestamps (Buildkit issue). With the debian base image now being selected via the DEBIAN_TAG variable, we also base our cache key on this one to improve the hit rate. Signed-off-by: Jan Kiszka <[email protected]>
- Loading branch information
1 parent
bb11941
commit 28f2d99
Showing
4 changed files
with
89 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,24 +13,36 @@ runs: | |
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
with: | ||
driver-opts: image=moby/buildkit:v0.13.0-rc3 | ||
- name: Login to ghcr.io | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ inputs.deploy-user }} | ||
password: ${{ inputs.deploy-token }} | ||
- name: Set SOURCE_DATE_EPOCH | ||
run: | | ||
echo "SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)" >> $GITHUB_ENV | ||
shell: bash | ||
- name: Determine Debian tag | ||
run: | | ||
DEBIAN_RELEASE=$(grep -m 1 'ARG DEBIAN_TAG=' Dockerfile | sed 's/.*DEBIAN_TAG=\(.*\)-.*/\1/') | ||
echo "DEBIAN_TAG=$(podman image search --list-tags debian --limit 1000000000 | \ | ||
grep "$DEBIAN_RELEASE-.*-slim" | sort -r | head -1 | sed 's/.*[ ]\+//')" >> $GITHUB_ENV | ||
shell: bash | ||
- name: Cache var-cache-apt | ||
id: cache-var-cache-apt | ||
uses: actions/cache@v4 | ||
with: | ||
path: var-cache-apt | ||
key: var-cache-apt-${{ hashFiles('Dockerfile') }} | ||
key: var-cache-apt-${{ env.DEBIAN_TAG }} | ||
- name: Cache var-lib-apt | ||
id: cache-var-lib-apt | ||
uses: actions/cache@v4 | ||
with: | ||
path: var-lib-apt | ||
key: var-lib-apt-${{ hashFiles('Dockerfile') }} | ||
key: var-lib-apt-${{ env.DEBIAN_TAG }} | ||
- name: Inject var-cache-apt into docker | ||
uses: reproducible-containers/[email protected] | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters