Subject:
Fly.io: “Not enough space to unpack image, possibly exceeds maximum of 8GB uncompressed” — but my exported image is ~3.4 GB
Issue Summary:
I’m unable to deploy my Next.js app to Fly.io. Every time I deploy, I get the following error, even though my local image is well under the 8 GB limit:
[info]Pulling container image registry.fly.io/abstracta-v2:deployment-...
[error]Not enough space to unpack image, possibly exceeds maximum of 8GB uncompressed
What I’ve Done / Observed:
- Local Docker build and export:
docker run -it --rm abstracta-v2 du -h -d 2 /
# (output)
3.2G /
2.6G /app
1.9G /app/node_modules
683.0M /app/.next
559.0M /usr
mkdir /tmp/abstracta-v2-fs
docker export $(docker create abstracta-v2:latest) | tar -C /tmp/abstracta-v2-fs -xf -
dua /tmp/abstracta-v2-fs
# (output)
3.36 GB total
- Deployed minimal/Hello World Docker images with no issues
- Destroyed and recreated app, machines, and Fly caches
- Pruned all local/remote Docker cache and images
- Deployed both with local and Fly cloud builds
- No large Fly.io volumes, mounts, or custom disk config
- No errors in local builds, no excessive files in the image
Relevant Logs from Fly.io:
2025-05-16T23:51:59Z runner[d899237f6de408] iad [error]Not enough space to unpack image, possibly exceeds maximum of 8GB uncompressed
2025-05-16T23:53:40Z runner[3d8d453da33358] iad [error]Not enough space to unpack image, possibly exceeds maximum of 8GB uncompressed
--> Build Summary: ()
--> Building image done
image: registry.fly.io/abstracta-v2:deployment-01J...
image size: 3.7 GB
Questions:
- Why does Fly.io think my image is over 8 GB when du/dua/docker export all show it’s well under?
- Is there a way to force Fly.io to clear any backend image/cache/registry data that might be stale or corrupted?
- Are there known quirks with image size calculations on Fly.io, or possible causes I’m missing?
Any advice on getting past this error or on additional debugging steps would be much appreciated. Thanks!