Debugging with GDB on linux/amd64 docker on Mac m1 host

I am using a Mac M1. Mac book pro (laptop).
I am using Docker to run linux/amd64. ubuntu:bionic.
I am unable to set break points in the code compiled in the container

  The repro steps are here

 docker pull ubuntu:bionic --platform linux/amd64
 docker run -it --cap-add=SYS_PTRACE --security-opt seccomp=unconfined 5a214d77f5d7
  #apt install gcc gdb
  # cat > test.c
  int main()
          return 0;

Control D

  gcc -g test.c
  gdb ./a.out
 gdb> start

The break point is not hitting. The program is exiting without hitting a breakpoint

I have encountered the same problem. Have you solved it?