I am attempting to containerize an application, I can compile it on amd64, as well as on an M1 macbook without issue. But when Github Actions builds the container, the arm64 architecture fails to compile one package.
In my experience, that is on-par for QEMU. I try to avoid that thing to the greatest extent possible. In your case, I believe that means not using buildx.
And, thank you for including details like the link to the build log.
No, you don't. The alternative is to build native images with a manifest. It's more work but the result is much better.
Unfortunately, I can't provide an example. When I did that sort of thing, the working stuff was not publicly available. I do remember it was not especially difficult; just more work. The goal was Linux (Alpine) for AMD and ARM processors. I think it was just one Docker file with the target processor specified at build. The Docker manifest is just a simple text file that identifies which images are available.
I should have mentioned ... Each native image was built on that platform. The AMD version was built on an AMD machine. The ARM version was built on an ARM machine. That eliminates the headache of trying to cross-compile.
So perhaps you could cross compile the binary, then put it in a docker image afterwards if you really need that part. It is likely going to be much faster too, avoiding the emulation overhead.
Also I belive there are other build services you can use together with github if you prefer to build native ARM?