Do more of the building in a "fat" Python image and copy the venv over to a "slim" app image. The way I learned this lesson is by experimenting around with e.g. Poetry git dependencies and finding I couldn't build stuff because my app stage base image was a python:slim that doesn't have git installed, and because I do the pip install from that stage I had to go to the "fat" images for the app—not good...
Do more of the building in a "fat" Python image and copy the venv over to a "slim" app image. The way I learned this lesson is by experimenting around with e.g. Poetry git dependencies and finding I couldn't build stuff because my app stage base image was a
python:slim
that doesn't have git installed, and because I do thepip install
from that stage I had to go to the "fat" images for the app—not good...