Can't restore Docker Buildx cache properly

Hi fellow developers. I’m currently stuck at an issue that keeps my build times at over 1h (which could be at around 10m if caching were working properly)

If you look for the build of one of my projects (, you’ll see that it recovers the build cache from the previous build under Cache Docker layers and when you check Build everything is CACHED. Nice. This is the CI file for it:

Back to the project with the 1h build time. This is the CI file:
Checking the currently latest run here ( you’ll see under Cache Docker layers that it gets the cache from the previous build just as fine. Ok great. When you look at Build API PHP (Docker) however, you’ll see the 1h build time, and nothing is CACHED. The only hint I get is this message:

time="2020-10-07T19:43:15Z" level=warning msg="local cache import at /tmp/.buildx-cache/api not found due to err: could not read /tmp/.buildx-cache/api/index.json: open /tmp/.buildx-cache/api/index.json: no such file or directory"

I also cache between test and deploy, so that I don’t need to build twice, and there it works. Under deploy everything is cached again. If you check Post Cache Docker layers it’s successful (and skipped under deploy because it’s already cached during test)

WHAT IS WRONG WITH BUILDX. Please someone help. These 1h waiting times are just annoying.

PS: I’m using these actions:

  • docker/setup-qemu-action@v1
  • docker/setup-buildx-action@v1
  • actions/cache@v2
  • docker/build-push-action@v2


You need to check if the file “/tmp/.buildx-cache/api/index.json” was indeed existing when you saved the cache.
I mean you need to conform if buildx indeed was installed in the directory “/tmp/.buildx-cache”.
If not, you need to find the directory where the “docker/setup-buildx-action” actually installed buildx to.

@brightran, checking the code, it doesn’t seem like docker/setup-buildx-action cares about where the cache is. But I’ll try running it again with ls -Al everywhere hahaha.


checking the code, it doesn’t seem like docker/setup-buildx-action cares about where the cache is.

Normally, the setup-buildx-action action should have a special path to install buildx, if the path (/tmp/.buildx-cache) you specify on the cache action is not consistent with or containing the installation path of buildx, buildx will not be saved as the part of cache.

That why I suggest you to confirm the actual installation path of buildx when using the setup-buildx-action action.