I’m not distributing anything publicly with Docker images, but for internal work projects we use the second approach. First a build stage, then copy the compiled binary + any runtime dependencies to a more minimal runtime image. Multistage builds thankfully make this pretty straightforward, as shown in the example you linked to.
That said, including the a complete suite of build and development dependencies in an image can be very helpful to share a consistent build environment with other developers or across systems.