-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Docker caching #31
Comments
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.
Nothing is in scope right now for |
I think I can do something with ghaction-docker-buildx action and use the local |
I tried but I hit the file limit, discussed at #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. |
Opened PR #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. |
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? |
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... 😄) |
No caching of Docker images yet, as that is not yet supported by GitHub Actions (see actions/cache#31).
No caching of Docker images yet, as that is not yet supported by GitHub Actions (see actions/cache#31).
Working example for me using buildx here: #260 (comment) |
No caching of Docker images yet, as that is not yet supported by GitHub Actions (see actions/cache#31).
I am unable to cache this for the moment. See: - actions/cache#31 - satackey/action-docker-layer-caching#19
My ci processes use several pre-built docker images, some of them are very large - 3.5GB! |
The cache option on
However, I have a use case for running tests in a dockerized setup.
Here every run pulls dependencies defined in |
Well, that is not that great in the minimalist's opinion. The syntax is very convoluted, and as you noticed, works partially. I hope some day, |
@DannyBen Yeah it's verbose but if it bothers you, create an action to wrap these into a one-liner. |
My company, ScribeMD, faced a similar issue and just released a dirt simple docker-cache action, which caches all Docker images whether built or pulled using said |
Just leaving an idea, haven't seen it discussed yet:
It has some problems which I hope someone smarter will know how to solve and share that knowledge:
Soooo... it does not work (as I said, this is an idea, not a solution :) ). |
Myself and others have run into a similar issue. I am not aware of another way around the permission errors currently besides using |
I have since learned of a much faster approach provided you have control over where the Docker image is pulled from. You can simply upload the Docker images you are pulling to the GitHub Container Registry, which spares you the cost of |
I run into the same issue: tried to cache /var/lib/docker with the result after cleanup (which means saving the cache I guess):
Donno if I made a mistake on the workflow file in the Cache Step:
|
No, you didn't make a mistake. Please give docker-cache a try. |
Thanks, I wanted to try it out before reporting back and works good, but not what I expected:
So caching is for me at this point a disadvantage, which bumps up the runtime of the workflow very drastically. Reducing the workflow runtime, was my goal by caching the layers. So thanks for the alternative, but I will skip using caching at this point. Will give it a try if the solution evolved. |
Apologies; I overlooked the fact that you were looking for Docker layer caching, which indeed is not the intended purpose of docker-cache. As your experiment demonstrated, docker-cache is geared towards those who are pulling images, not building them. I suggest using the official Docker build push action, which performs layer caching and/or hosting your images in the GitHub Container Registry (possibly in addition to anywhere else they might be hosted). |
No Problem, that's why I tested it out if it would work for my use case. And thanks for the Build Push Action and the GitHub Container Registry. Maybe the speed from a GH-Runner to that registry is faster than pushing to resources outside. I will also try out, if a image hosted on GCR can be pulled down faster than Docker Hub, thanks for the idea 👍🏼 this maybe also speed up the process if it works |
Yes, credit to Thai Pangsakulyanont for his excellent blog post showing that pulling from GHCR is as fast as pulling from the cache, but since it's a pure |
This issue is stale because it has been open for 200 days with no activity. Leave a comment to avoid closing this issue in 5 days. |
Would love to see this feature in 2023. |
What would be the benefit of implementing this here if there's a GH caching available via Example: - name: Build and push
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: user/app:latest
cache-from: type=gha
cache-to: type=gha,mode=max Links: |
This forces you to use the docker action rather than relying on a generic docker caching solution. |
It does not cache pulled images. For us, that is the most time spent in our actions. |
This 👆 |
Should we try to use this cache action to cache docker layers, doing trickery with
docker save
anddocker load
, or are you working on a different path for Docker caching?The text was updated successfully, but these errors were encountered: