Docker: Reduce the size of a container
using https://alpinelinux.org can reduce the size and deployment time of a container by up to 40%
Install minimum packages
- Bulkier images take time to get pulled.
- Increased time to spin up a container using it.
- Include a .dockerignore file.
- Reduce unnecessary dependencies.
- multistage build pattern. Made a binary on the build stage and used it to run the container.
- Squashing helps with organizing images in logical layers. Instead of having an image with multiple (in almost all cases) unnecessary layers - we can control the structure of the image.
Keep Exploring!!!
No comments:
Post a Comment