Add caching of image files to build process
Background
- @szepeviktor was gracious and contributed caching
- I temporarily commented this out in the actions file to solidify the build before
Caching will be helpful because:
- Saves time in CI
- We are good internet citizens by not draining @oerdnj's bandwidth resources
Scenarios to consider
✅ When we want a build
- There is an update to the
base_image(ubuntu:20.04) - There is an update in @oerdnj's repository
🛑 DO NOT build when
- There are no updates for @oerdnj's repo
(notice we still need to build even if there are not updates for the base_image)
Possible solutions
- Check hash of @oerdnj's repo (http://ppa.launchpad.net/ondrej/php/ubuntu/dists/focal/Release)
- Something like
docker run ... /bin/bash -c "dpkg -l|shasum"
Related comment: https://github.com/serversideup/docker-php/commit/26723e7bc28e5b9e8e56ca552ab9b78b381d2171#r48044607
Next steps
- Finish the structuring (#9) first, then loop back to this
Cache (the hash of) this file: http://ppa.launchpad.net/ondrej/php/ubuntu/dists/focal/Release
Done 🍏
Please send the usual €1 000 000
Actually building the image and checking it for changes would be the ultimate solution. But timestamps make it impossible.
But you may experiment with docker run ... /bin/bash -c "dpkg -l|shasum"
Adding a note, I wonder if we use "Build X" (BuildKit) as provided in this demo? https://github.com/docker/build-push-action
I wonder if we
To answer that you need someone who lives in the Docker ecosystem.
Updated the notes above. Temporarily commented out the caching for now and will loop back to this later.
Focusing on the structure for now.