I am very new to Docker but enjoying the study. Recently I have tried to build an image for a simple ML app that I had build earlier. I have used python:3.11-slim base image and installed a few dependencies. After the final build, the image size turned out to be 1.13 GB. How is this happening?
Following is my Dockerfile:
FROM python:3.11-slim
EXPOSE 8080
ADD requirements.txt requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
WORKDIR /app
RUN apk del .build-deps
COPY . .
ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8080"]
=================================================================
Following is my requirements.txt:
joblib==1.4.2
numpy==1.26.4
scikit-learn==1.5.0
scipy==1.13.1
streamlit==1.35.0
xgboost==2.1.0
New contributor
user27420839 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1