docker-php icon indicating copy to clipboard operation
docker-php copied to clipboard

Add caching of image files to build process

Open jaydrogers opened this issue 4 years ago • 6 comments

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:

  1. Saves time in CI
  2. 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

  1. Check hash of @oerdnj's repo (http://ppa.launchpad.net/ondrej/php/ubuntu/dists/focal/Release)
  2. 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

jaydrogers avatar Mar 09 '21 14:03 jaydrogers

Cache (the hash of) this file: http://ppa.launchpad.net/ondrej/php/ubuntu/dists/focal/Release

Done 🍏

szepeviktor avatar Mar 09 '21 14:03 szepeviktor

Please send the usual €1 000 000

szepeviktor avatar Mar 09 '21 15:03 szepeviktor

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"

szepeviktor avatar Mar 09 '21 16:03 szepeviktor

Adding a note, I wonder if we use "Build X" (BuildKit) as provided in this demo? https://github.com/docker/build-push-action

jaydrogers avatar Mar 09 '21 17:03 jaydrogers

I wonder if we

To answer that you need someone who lives in the Docker ecosystem.

szepeviktor avatar Mar 09 '21 18:03 szepeviktor

Updated the notes above. Temporarily commented out the caching for now and will loop back to this later.

Focusing on the structure for now.

jaydrogers avatar Mar 09 '21 20:03 jaydrogers