A docker image that will run LibreOffice in headless mode, exposing its Universal Network Objects (UNO) API on port 8100.
I use this together with 2 brilliant Java libraries (jodconverter and jodreports) that consume the API to convert documents and generate reports based on ODT templates.
For convenience I also include the Universal Office Converter (unoconv) tool in the image.
docker run -d --name libreoffice -p 8100:8100 hdejager/libreoffice-api
docker cp test.html libreoffice:/tmp/test.html
docker exec -ti libreoffice \
unoconv \
--connection 'socket,host=127.0.0.1,port=8100,tcpNoDelay=1;urp;StarOffice.ComponentContext' \
-f pdf /tmp/test.html
docker cp libreoffice:/tmp/test.pdf .