consoleme icon indicating copy to clipboard operation
consoleme copied to clipboard

Optimize Docker Image size

Open castrapel opened this issue 3 years ago • 2 comments

The docker image is unnecessarily large. There are optimizations we can do to reduce it, ie: The ones described here.

castrapel avatar Mar 19 '21 17:03 castrapel

@castrapel cool! just read through the article and summarized it below so future contributors don't need to read the whole thing to get started on this.

  • [ ] use a .dockerignore file
  • [ ] use a smaller base image
  • [ ] use multi-stage builds
  • [ ] avoid adding unnecessary layers
  • [ ] avoid installing unnecessary dependencies
  • [ ] for caching: place instructions that are likely to change as low in the Dockerfile as possible

currently, am trying to build a Docker image using python3.8-alpine, not python3.8 as we are now.

veeral-patel avatar Apr 28 '21 01:04 veeral-patel

Went ahead and built consoleme's current Dockerfile locally, using docker build -t consoleme ..

Resulting image is 2.73 GB, so we can compare future optimizations.

veeral-patel avatar Apr 28 '21 01:04 veeral-patel