Our container images were 2GB. We didn't know why.

⚙️ Use Case

Simple Node.js app. Should have been 200MB. docker images showed 2.1GB.

Checked the Dockerfile. Looked normal. Then realized I never added a .dockerignore file.

The build context was copying everything .git, local node_modules, old backup folders, logs. About 1.6GB of garbage.

I asked Blackbox to look at the Dockerfile and it pointed out the missing .dockerignore right away. Also suggested copying package.json first and using --production for npm ci.

Added .dockerignore, made those changes. Image dropped to 180MB.

Took 10 minutes to fix something that had been wasting space for months.

Posted May 2, 2026, 2:05 PM UTC

36
Loading comments…