Image build with Depot: 60 MB, locally build image: 219 MB. Why the difference?

fly deploy \
  --remote-only \
  --config fly.my-app.toml \
  --dns-checks=false \
  --image-label v69

image size: 60 MB

fly deploy \
  --local-only \
  --config fly.my-app.toml \
  --dns-checks=false \
  --image-label v69

image size: 219 MB

Is the difference a sum of many optimizations Depot does, or is it just compression setting (etc) that my local builder is not using?

Such a simple question, yet so trivial all at the same time!

I wanna say, the difference is very likely the sum of many smaller optimizations and differences that the remote builder (Depot / Fly) is applying under the hood, rather than a single “missing compression flag” on your local build

1 Like

Just a thought; if the remote build sends the data to the standard Fly Docker registry, you could auth to the registry, pull the image to your local machine, and then do some layer introspection upon it. I only have a vague idea how to do that, but I am sure with a bit of research, having both images side-by-side would soon show how they’re different.

1 Like

I asked around and found out that Depot show the compressed size and Docker uncompressed.

And turns out they’re the same size :slight_smile:

REPOSITORY             TAG    IMAGE ID       CREATED             SIZE
registry.fly.io/psl    v357   f4158f3f9981   11 minutes ago      219MB
registry.fly.io/psl    v356   6cda4723ad1c   About an hour ago   219MB

Anyway, good to know.

4 Likes