consoleme
consoleme copied to clipboard
Optimize Docker Image size
The docker image is unnecessarily large. There are optimizations we can do to reduce it, ie: The ones described here.
@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.
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.