The same scratch container can be used, so the steps are the same too, even easier since fpc compiles statically already.
FROM scratch
ADD yourcompiledprog /
CMD ["/yourcompiledprog"]
should be sufficient. Indeed it is:
$ sudo docker build -t hello -f hello.scratch .
[sudo] password for leledumbo:
Sending build context to Docker daemon 40.73MB
Step 1/3 : FROM scratch
--->
Step 2/3 : ADD hello /
---> 5479290cd757
Removing intermediate container e8000e26f899
Step 3/3 : CMD /hello
---> Running in d862efdcf885
---> e8004dc298a6
Removing intermediate container d862efdcf885
Successfully built e8004dc298a6
Successfully tagged hello:latest
$ sudo docker run -it hello
Hello, World