Arise NixOS acolytes, arise!
All jokes aside, to expand on this for others, you can fix a lot of dependencies but as soon as you start your dockerfile with a FROM, youre hiding a bunch of dependencies which you no longer control, behind that command. An example would be:
FROM tiangolo/uvicorn-gunicorn-fastapi
If tiangolo decides to update anything in the base image defined here, your build is now different to how it was before without really knowing