Docker buildx with cache options fails

I just changed the docker build options to use —cache-from and –cache-to options.

However, docker buildx build fails with the error

[2026-01-19T17:47:27Z] ERROR: failed to build: Cache export is not supported for the docker driver.
[2026-01-19T17:47:27Z] Switch to a different driver, or turn on the containerd image store, and try again.
[2026-01-19T17:47:27Z] Learn more at https://docs.docker.com/go/build-cache-backends/

I am following this resource: BuildKit container builds | Buildkite Documentation

Hey @vbk42 :waving_hand:

If you’re using the default docker driver, you’re going to run into these errors as only local cache is supported. It’s called out in that error there, but you will need to use a different driver or turn on the containerd image store.

One other thing to note if you’re trying to use AWS S3 as your cache backend, The S3 cache backend is an experimental Docker BuildKit feature. It requires creating a custom buildx builder with a non-default driver (such as docker-container), as the default Docker driver does not support AWS S3 cache.

If I use the customer docker-container driver, I can get the cache working. However, I am not able to use “from :” for multi-stage builds. This seems to be a known bug that people have solved with “–load” option or configuring snapshot above.

Any advice on getting both ECR Cache + local image reference for multi=stage builds (without pushing to remote repo first)?

Hey @vbk42 , I did some testing and I believe you’ve identified the exact trade-off with the docker-container driver: it supports registry cache but isolates BuildKit from your host Docker daemon, preventing it from accessing local images. The solution is to enable Docker’s containerd image store. This allows the default driver to support registry cache backends (like ECR) while maintaining access to local images for multi-stage builds. You should be able to enable containerd image store by adding the following to your /etc/docker/daemon.json on your Elastic CI Stack instances.

{
  "features": {
    "containerd-snapshotter": true
  }
}

If you already have a daemon.json file with other settings (like userns-remap, insecure-registries, etc.), merge this features block into your existing configuration.

You can verify if containerd image store is enabled by using a command like

docker info | grep -i snapshotter

Additionally, I’d like to mention that you can also consider using this Buildkite ECR cache plugin as I believe that’d help with your use case as well. Please take a look and see if it helps: https://github.com/seek-oss/docker-ecr-cache-buildkite-plugin

Lastly, if you need further support for your use case, I’d suggest reaching out to Buildkite support via support@buildkite.com as it would allow us to assist you more easily.

Thanks,

Dahtey