Skip to content

Commit

Permalink
Merge #650
Browse files Browse the repository at this point in the history
650: Improve Docker caching. r=Emilgardis a=reitermarkus

Also use pushed images as cache.

Co-authored-by: Markus Reiter <me@reitermark.us>
  • Loading branch information
bors[bot] and reitermarkus authored Mar 15, 2022
2 parents 2cc449a + 84852d8 commit ed729e7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
7 changes: 4 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ This project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

- #650 - Improve Docker caching.
- #588 - fix ci: bump openssl version in freebsd again
- #552 - Added CHANGELOG.md automation
- #543 - Added environment variables to control the UID and GID in the container
- #534 - fix image builds with update of dependencies
- #502 - fix ci: bump openssl version in freebsd
- #501 - x86_64-linux: lower glibc version requirement to 2.17 (compatible with centos 7)
- #500 - use runner setting specified in Cross.toml
- #501 - x86_64-linux: lower glibc version requirement to 2.17 (compatible with centos 7)
- #500 - use runner setting specified in Cross.toml
- #498 - bump linux-image version to fix CI
- #497 - don't set RUSTFLAGS in aarch64-musl image
- #497 - don't set RUSTFLAGS in aarch64-musl image
- #492 - Add cmake to FreeBSD images
- #489 - Add support for more hosts and simplify/unify host support checks
- #477 - Fix Docker/Podman links in README
Expand Down
18 changes: 13 additions & 5 deletions build-docker-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,21 @@ run() {
;;
esac

build_args+=(--pull)
build_args+=(
--pull
--cache-from "type=registry,ref=${image_name}:main"
)

if "${push}"; then
build_args+=(--cache-to 'type=inline')
fi

if [[ -n "${GITHUB_ACTIONS-}" ]]; then
build_args+=(
--cache-from "type=gha,url=${ACTIONS_CACHE_URL},token=${ACTIONS_RUNTIME_TOKEN}"
--cache-to "type=gha,mode=max,url=${ACTIONS_CACHE_URL},token=${ACTIONS_RUNTIME_TOKEN}"
)
build_args+=(--cache-from "type=gha,url=${ACTIONS_CACHE_URL},token=${ACTIONS_RUNTIME_TOKEN}")

if ! "${push}"; then
build_args+=(--cache-to "type=gha,mode=max,url=${ACTIONS_CACHE_URL},token=${ACTIONS_RUNTIME_TOKEN}")
fi
fi

for tag in "${tags[@]}"; do
Expand Down
2 changes: 1 addition & 1 deletion docker/linux-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ main() {
# there is no stable port
arch=ppc64
# https://packages.debian.org/en/sid/linux-image-powerpc64
kversion='5.16.0-4'
kversion='5.*'
kernel="${kversion}-powerpc64"
libgcc="libgcc-s1"
debsource="deb http://ftp.ports.debian.org/debian-ports unstable main"
Expand Down

0 comments on commit ed729e7

Please sign in to comment.