├── .dockerignore ├── .gitignore ├── Dockerfile ├── README.md ├── build.sh ├── convert.sh └── entrypoint.sh /.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | build.sh 4 | convert.sh -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | 3 | LABEL maintainer="r.kummer@ipunkt.biz" \ 4 | version.ubuntu="18.04" 5 | 6 | ENV DEBIAN_FRONTEND noninteractive 7 | 8 | RUN apt-get update && \ 9 | apt-get -y -q install \ 10 | libreoffice \ 11 | libreoffice-writer \ 12 | ure \ 13 | libreoffice-java-common \ 14 | libreoffice-core \ 15 | libreoffice-common \ 16 | openjdk-8-jre \ 17 | fonts-opensymbol \ 18 | hyphen-fr \ 19 | hyphen-de \ 20 | hyphen-en-us \ 21 | hyphen-it \ 22 | hyphen-ru \ 23 | fonts-dejavu \ 24 | fonts-dejavu-core \ 25 | fonts-dejavu-extra \ 26 | fonts-droid-fallback \ 27 | fonts-dustin \ 28 | fonts-f500 \ 29 | fonts-fanwood \ 30 | fonts-freefont-ttf \ 31 | fonts-liberation \ 32 | fonts-lmodern \ 33 | fonts-lyx \ 34 | fonts-sil-gentium \ 35 | fonts-texgyre \ 36 | fonts-tlwg-purisa && \ 37 | apt-get -y -q remove libreoffice-gnome && \ 38 | apt -y autoremove && \ 39 | rm -rf /var/lib/apt/lists/* 40 | 41 | RUN adduser --home=/opt/libreoffice --disabled-password --gecos "" --shell=/bin/bash libreoffice 42 | 43 | ADD entrypoint.sh /opt/libreoffice/entrypoint.sh 44 | RUN chmod +x /opt/libreoffice/entrypoint.sh 45 | 46 | VOLUME ["/tmp"] 47 | WORKDIR "/tmp" 48 | 49 | ENTRYPOINT ["/opt/libreoffice/entrypoint.sh"] 50 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Libreoffice Headless Docker Image 2 | 3 | ## Purpose 4 | 5 | Running headless libreoffice can help for various use cases. For example converting office documents with a better result than unoconv does. 6 | 7 | ## Build 8 | 9 | We provide a `build.sh` script to build the docker container. 10 | 11 | ## Use Cases 12 | 13 | ### Converting to HTML 14 | 15 | As one example we provide the `convert.sh` script to convert a given local office file to html. 16 | 17 | ## Docker Hub 18 | 19 | Our image will be published on docker hub. 20 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | docker build --pull -t ipunkt/libreoffice-headless:latest . 4 | -------------------------------------------------------------------------------- /convert.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | docker run --rm -it -v $(pwd):/tmp --name libreoffice-headless ipunkt/libreoffice-headless:latest --convert-to html "$@" -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | /usr/bin/libreoffice --nologo --norestore --invisible --nolockcheck --nodefault --headless "$@" 4 | if [ -d "/tmp/hsperfdata_root" ]; then 5 | rm -rf /tmp/hsperfdata_root 6 | fi --------------------------------------------------------------------------------