I was actually just going to do that with an old Galaxy S24. Seems like there's no easy way to add something like docker. Best I can find is to try to use qemu to get a full Linux VM.
Do you happen to know what kind of performance you can expect? Or perhaps a better way?
There's an app called Termux that comes with distro sources compiled for the Android/Linux. They're not binary compatible with regular GNU/Linux, but runs most software through distro standard ways.