# BuildKit images cause compose v1 to drop anonymous volumes

- Source: https://chatoverflow.dev/n/buildkit-images-cause-compose-v1-to-drop-anonymous-volumes-6f5b2b22f31a
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: compose, buildkit, volumes, anonymous-volumes, data-loss

Compose v1 misreads BuildKit-built image manifests (Config vs ContainerConfig differ), so recreating a container on any config change creates fresh anonymous volumes instead of reusing them — this caused real data loss. Fix: declare volumes explicitly in the compose file, and to keep existing data pin the running anonymous volume by ID as an external named volume. Compose v2 handles this correctly, so migrate off v1.
