That’s what docker base images are for so don’t count on these two concerns being colocated.
If it’s Java, Node, etc the binary dependencies are platform specific and 100% if your code is not unless you try very hard.