Should we try to use this cache action to cache docker layers, doing trickery with docker save and docker load, or are you working on a different path for Docker caching?
You're welcome to use this for caching docker layers! If you get something figured out we can add it as an example usage of this action.
are you working on a different path for Docker caching?
Nothing is in scope right now for v1 of this action that's specific to the Docker scenario, but it might already work.
I think I can do something with ghaction-docker-buildx action and use the local --output.
I tried but I hit the file limit, discussed at https://github.com/actions/cache/issues/6
Since docker is now natively integrated in Github actions, I think it would be nice if there was an option to enable docker caching globally, like CircleCI does.
@tuler also tried to cache with a tarball on https://github.com/actions/cache/issues/33. It seems to be a good solution.
https://github.com/actions/cache/pull/37 also was opened.
Opened PR https://github.com/actions/cache/pull/37 with an example for Docker layer caching.
@steebchen I agree. Docker caching should be natively supported, not through this action.
cc: @neovintage
The cache file limit has been increased from 400 MB to 2 GB, so this may be more viable than previously due to docker layers being larger than the previous limit.
@steebchen I agree. Docker caching should be natively supported, not through this action.
Seems like a lot of people agree to that statement. Where is the proper place to post such a request? In the runner repo? Perhaps someone in the inner circle should post it as a feature request in the appropriate place and post a link here?
@DannyBen See https://github.com/actions/cache/issues/81 where we're tracking Docker caching of actions
Any update of the progress?
+1
👋 Hi all, right now we are focusing on other priorities and there are no updates for docker caching. We appreciate your feedback and revisit priorities based on user feedback, so please continue sending us your input.
What's bothering me most is that all Github Actions (which are based on Docker) are always rebuild from scratch, in every single action. I've never worked in projects as big as GitHub, but I can't imagine how caching is not the solution here – just for the reason that it costs bandwidth to fetch the images each time. I'd also be happy to upgrade to a more expensive plan or pay for the cache storage costs.
(edit: I just realised I already commented in this thread... :smile:)
Working example for me using buildx here: https://github.com/actions/cache/issues/260#issuecomment-638469605
My ci processes use several pre-built docker images, some of them are very large - 3.5GB!
github actions pulls these images again and again on every run burning a lot of time and cpu.
A built in cache thats got a reasonable expiry behind each repo is really required here. Sooo much dealing with github actions seems to be spent working around paradigm/api failures or missing features.
This is a big one, please give us some better options.
Hello, I am wondering if this issue has bubbled back up on the action/cache's priority list? I am wondering if there is a difficult technical challenge blocking this feature, as on its surface it seems like it would be a huge benefit to both users running actions and reduce load on GH infrastructure.
@mikelax Would https://github.com/satackey/action-docker-layer-caching work for your case? It's built on top of this action.
@mikelax Would https://github.com/satackey/action-docker-layer-caching work for your case? It's built on top of this action.
This linked action says it will use following method to take care of caching:
This GitHub Action uses the docker save / docker load command and the @actions/cache library.
While ago, @dtinth published an article _Caching Docker builds in GitHub Actions: Which approach is the fastest? 🤔 A research._ (https://dev.to/dtinth/caching-docker-builds-in-github-actions-which-approach-is-the-fastest-a-research-18ei). He found the docker save/load method is far from the best solution. Worth taking a look whether you are trying to cut some seconds.
Hoping this bubbles up the priority list soon!
Most helpful comment
Since docker is now natively integrated in Github actions, I think it would be nice if there was an option to enable docker caching globally, like CircleCI does.