title: What problems can I have if my docker image is 2.5GB & how can I reduce the size?
body: <p>I have a Python based machine learning project that I want to dockerize. I have several heavy dependencies, like, <a href="https://github.com/davisking/dlib" rel="nofollow noreferrer">dlib</a>, <a href="https://github.com/ageitgey/face_recognition" rel="nofollow noreferrer">face_recognition</a>, <a href="https://www.tensorflow.org/" rel="nofollow noreferrer">tensorflow</a>, <a href="https://pypi.org/project/opencv-python/" rel="nofollow noreferrer">OpenCV</a> etc. </p>
  
  <p>Following is my docker file</p>
  
  <pre><code>FROM ubuntu:18.04
  WORKDIR /app
  RUN apt update \
      &amp;&amp; apt -y upgrade \
      &amp;&amp; apt install -y python3 \
      &amp;&amp; apt install -y python3-pip \
      &amp;&amp; apt install -y poppler-utils \
      &amp;&amp; apt install -y libsm6 libxext6 libxrender-dev
  
  ARG DEBIAN_FRONTEND=noninteractive
  
  RUN apt install -y postgresql
  
  COPY dlib-19.17.0-cp36-cp36m-linux_x86_64.whl /app/dlib-19.17.0-cp36-cp36m-linux_x86_64.whl
  COPY requirements.txt /app/requirements.txt
  
  RUN pip3 install dlib-19.17.0-cp36-cp36m-linux_x86_64.whl \
      &amp;&amp; pip3 install -r requirements.txt
  
  COPY . /app
  
  CMD gunicorn -t 300 --workers 5 --bind  0.0.0.0:8080 wsgi
  </code></pre>
  
  <p>After building the image, it turns out to be 2.5 GB. Is it ok to have an image this big? If no, how can I reduce the size while maintaining the dependencies. </p>