2025-01-07T19:52:06 2025-01-07T19:52:06 409165933
My docker size is like 500mb but:
It seems to be overwritten with each new version, the size keeps increasing 500mb 500mb.
It seems to be overwritten with each new version, the size keeps increasing 500mb 500mb.
It seems to be overwritten with each new version, the size keeps increasing 500mb 500mb.
Hi @Mountain,
Welcome to the Google Cloud community!
When you package your app into a container, you might accidentally include files that aren't actually needed when the app runs, like tools used during the build process. This makes the size increase of the container, which slows down loading and costs more to store.
To help reduce the size, create two separate parts: one for building the app and another for creating the final container that only includes the essential files for running the app.
Here's a breakdown of how to optimize Docker images using Google Cloud services:
1. Optimize Dockerfile
RUN
commands where possible to reduce the number of layers.2. Choose a Smaller Base Image
docker image prune
Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.