This won't work on the new M1 macs since it uses VirtualBox

Yeah :(

Ever since I switched to an M1, I haven't found a way to reliably build and run x86_64 containers on it.

Docker desktop with Qemu is not just painfully slow, it's also very buggy and some containers just can't be built without crashing.

Is there any alternative?

I haven't tested it, but Lima purports to support it:

https://github.com/lima-vm/lima/blob/master/docs/multi-arch....

Give https://github.com/abiosoft/colima

A try, I’ve been using it for a few months on both m1 and x64.

It works really well.