Parallel image loads from docker compose build fail with "No such file or directory (os error 2)"

Open
#756 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
22/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
docker, docker-compose, rust
Domain
devtools

Research direction

The failure is in the image-load path when several BuildKit tarballs are sent to the engine at once, so the relevant code is in the Rust runtime's image import and tarball handling, not in the Compose side. Reproduce with a project of many services sharing one Dockerfile and look for a temporary file that is removed or not yet written when the parallel load reads it. Done means parallel loads of all services succeed in one run, with a test that exercises concurrent imports.

Written by the indexing model from the issue text.

Description

Summary

When docker compose build builds many images in parallel, BuildKit sends all the image tarballs to the engine at about the same time. One of the loads fails with:

ERROR: rpc error: code = Unknown desc = Error response from daemon: No such file or directory (os error 2)

Building the same services one at a time (docker compose build <service> in a loop) succeeds every time.

Environment

  • Kiri 0.2.1 (engine 27.5.1, API 1.47), macOS 26.4, Apple silicon (arm64)
  • Docker CLI 29.9.2, Docker Compose 5.6.1, buildx 0.38.1

Steps to reproduce

  1. Use a Compose project with about 13 services that each build their own image (most share one Dockerfile).
  2. Run docker compose build (parallel build, default settings).

What happens

  • All 13 images reach exporting to docker image format → sending tarball together (each takes about 30 s).
  • One of them (a different service on different runs) fails with the error above, and the build stops.
  • Setting COMPOSE_BAKE=false or COMPOSE_PARALLEL_LIMIT did not help.

Build log excerpt:

#53 [audio-worker] exporting to docker image format
#53 exporting layers 13.2s done
#53 exporting manifest sha256:abbfa98b... 0.0s done
#53 exporting config sha256:73a2dec5... 0.1s done
#53 sending tarball 30.5s done
#53 ERROR: rpc error: code = Unknown desc = Error response from daemon: No such file or directory (os error 2)
target audio-worker: failed to solve: rpc error: code = Unknown desc = Error response from daemon: No such file or directory (os error 2)

Expected

Parallel image loads succeed, as they do when the images are loaded one at a time.

Workaround

Build services one by one: for s in $(docker compose config --services); do docker compose build "$s"; done

Dominant language
Rust
Stars
7.5k
Forks
329
Avg merge
15h 49m
Merged PRs (30d)
241

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from libracoder/kiri

All issues in libracoder/kiri

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.