Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Docker caching. #650

Merged
merged 3 commits into from
Mar 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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