-
Notifications
You must be signed in to change notification settings - Fork 60.7k
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
Please provide an example on how to save and load docker images to/from cache #31230
Comments
Thanks for opening this issue. A GitHub docs team member should be by to give feedback soon. In the meantime, please check out the contributing guidelines. |
@Nefcanto Thank you for opening this issue! I'll get this triaged for review ✨ |
Hey @Nefcanto, thank you so much for opening this issue and providing helpful context! You or anyone else is welcome to open an issue to add a Docker example to the doc. It is helpful if you can also link to a successful workflow run that uses the example code when you submit the PR. Thank you! ⚡ |
@SiaraMist, thanks for replying. If I could do it, I would not ask for it in the docs. The reason I asked is that I can not do it and I can't find a successful example online. I even asked ChatGPT and Gemini and they could not help. Some people even argue that it's by intention and GitHub does not want images to be cached. |
@Nefcanto it's quite doable although I'm not at all sure caches are the right tool for your use case.
Here's the proof-of-concept that I threw together for using caches:
And here's a log from
|
@APCBoston, I got it. Though you manually cached the images, this was a creative approach. In fact, you cached a bunch of compressed files. And you used the |
I don't think of it as particularly creative... you asked for an example of how to use |
Code of Conduct
What article on docs.github.com is affected?
https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows
What part(s) of the article would you like to see updated?
In the examples, there is only one example of how to use cache with npm. Also, another example lists cache keys.
Can you please add an example of how to use
docker save
anddocker load
to cache large docker images? This hugely reduces the network overhead.Additional information
To boost the performance of an action, we need to pull docker images. Those images are big. Sometimes 2 or 3 GB and we run our actions many times. This means 20 or 30 GB of data needs to be exchanged per day.
We can't write the YAML necessary to use cache with docker.
The text was updated successfully, but these errors were encountered: