Hello. I’m new to Docker - and to Fly.
I’ve written a very small Express.js app, and deployed ( successfully ).
I don’t have a Dockerfile.
But I noticed at build time, the image size is 774MB. Is this normal?
Does this affect anything? Am I missing something here?
I’ve set a build-args NODE_ENV=“production”, and I can see it doesn’t skip prunning anymore. But the image size remains pretty much the same.
If you aren’t using mutli-stage builds, you should: Docker Multi-Stage Builds | Codefresh
Here’s a mutli-stage
dockerfile from our nodejs project that deploys to Fly: serverless-dns/node.Dockerfile at 04a1184189905fcbe3e28dedff61f3c70190c2b0 · serverless-dns/serverless-dns · GitHub (size is ~150M, I think…)
I’ve been meaning to experiment with railway nixpacks, but unsure whether using it as-is optimizes for the image size, as well: Build images with nixpacks
Nixpacks still create large images.
Large images are irritating, but not usually a problem. I would be concerned about a 1.5GB+ image. 800MB is not so bad.
I make all my images small, though. It’s a fun exercise.