I have no experience actually coding one, but it involves writing a JSON document to let rockstor know how to configure a docker image. The documentation gives an overview of how the rock-ons work within the UI, while the rock-on registry hosts the existing JSON files and provides more detailed information (see its README).
You can also check out this recent forum post where some further rock-on questions were answered.