As other comments have mentioned, this isn't what Docker is for.
For Python, you'd use something like Py2App or whatever the current thing is. And Py2Exe for Windows.
https://py2app.readthedocs.io/en/latest/
https://pypi.org/project/py2exe/
PS: I typed your question into GPT 4 verbatim and it pointed me to PyInstaller, as well.