DOCKER CONTAINER WITH PERF FOR MACBOOK ARM PROCESSORS
This is a Docker container with the perf tool running on Mac ARM processors (tested on MacBook Pro M1, M2, and M3). The base operating system (OS) is Ubuntu, and then Perf is installed. The trick is to execute the compiled binary; the binary generated by the Install option fails.
To build the image and running the container in an interactive session:
docker compose up -d && docker exec -it perf_container bash
*** Credit to Jorge Ramos because he was the one who figured out the corrupt binary trick.