ci: include the architecture in the docker cache key

We're starting to include native aarch64 machines in our CI, but before
this commit the architecture wasn't included in the cache key for our
Docker images. This means there could be conflicts between images
produced on different architectures, hurting our CI times.

This commit fixes the problem by including the output of `uname -m` in
the cache key.
This commit is contained in:
Pietro Albini 2020-06-05 12:36:09 +02:00
parent 1149cf04de
commit e1ea006701
No known key found for this signature in database
GPG Key ID: 3E06ABE80BAAF19C

View File

@ -57,6 +57,10 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then
# Sort the file names and cat the content into the hash key
sort $copied_files | xargs cat >> $hash_key
# Include the architecture in the hash key, since our Linux CI does not
# only run in x86_64 machines.
uname -m >> $hash_key
docker --version >> $hash_key
cksum=$(sha512sum $hash_key | \
awk '{print $1}')