Currently flatpak uses appstream-glib to parse and generate appstream files however, appstream-glib is no longer maintained and this has resulted in many features not being propagated to flatpak. There is currently 2 prs porting flatpak & flatpak-builder to appstream.
I recently used melange and apko to build a from scratch image. The result was a set of auditable and easy to use container and apk repository. The toolkit reduces the work need to make from scratch images with minimal work on the actual docker container(which can be quite painful if you've tried making a from scratch image on your own).