ERROR: (*service).Write failed: rpc error: code = Unavailable

Hi,

once in a while, while creating a docker container, I get the following error message:

ERROR: (*service).Write failed: rpc error: code = Unavailable desc = ref layer-sha256:b4c2f45cc053d8d4f6162c0a288b3b73ece85435ec0c3fbd0fc75b4e8c1d1aaa locked for 3.916µs (since 2026-07-01 08:38:12.394391 +0200 CEST m=+36.880718543): unavailable

My workaround currently is, to just repeat the build:

docker buildx build --platform=linux/amd64 -t windows_build_amd64 -f DockerfileWindows --cache-from type=local,src=/Users/todi/.docker-cache-0.0 --cache-to type=local,dest=/Users/todi/.docker-cache-0.0,mode=max /Users/todi/bootloader --output type=docker --target qt

Any idea, as how to make automations with docker more reliable? Any parameters that I could change?

What makes me especially nervous is, that the command returns without indicating an error. So if you pipe that command above with `docker builds … && echo “success”`, you will see a success.

TIA

Torsten

Docker version 29.5.3, build d1c06ef

macOS 15.7.7 (24G720)

docker.desktop 4.79.0 (230596)

Buildx v0.34.1-desktop.1