"No one is harder on a talented person than the person themselves" - Linda Wilkinson ; "Trust your guts and don't follow the herd" ; "Validate direction not destination" ;

July 14, 2023

Docket Notes - Image Sizes

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

Reducing Docker Image size

  • 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.

.dockerignore

docker-squash

  • 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: