Container image for unoserver
This Container image uses Alpine Linux as a base image and provides:
-
Fonts (Alpine packages)
-
font-noto
-
font-noto-cjk
-
font-noto-extra
-
terminus-font
-
ttf-font-awesome
-
ttf-dejavu
-
ttf-freefont
-
ttf-hack
-
ttf-inconsolata
-
ttf-liberation
-
ttf-mononoki
-
ttf-opensans
-
|
Note
|
The docker can normally be replaced with podman as well.
|
Just run:
docker run -it -v <your directory>:/data/ ghcr.io/unoconv/unoserver-dockerAfter you start the container, you can use unoconvert command to convert documents using LibreOffice.
or to convert directly using unoconvert:
docker run -it -v <your directory>:/data/ ghcr.io/unoconv/unoserver-docker unoconvert /data/document.docx /data/document.pdfDocker maps your directory with /data directory in the container.
You might need to add the option :z or :Z like <your directory>:/data/:z or <your directory>:/data/:Z if you are using SELinux. See Docker docs or Podman docs.
docker run -p 2003:2003 ghcr.io/unoconv/unoserver-dockerAfter you start the container, you can use unoconvert command to convert documents using LibreOffice.
|
Note
|
You must use --host-location otherwise unoconvert will default to local although running unoserver in a container should be handled as remote.
|
unoconvert --host-location remote example.docx example.pdfYou can configure unoserver behavior using environment variables. If an environment variable is not set, the corresponding parameter will not be passed to unoserver (using unoserver’s default behavior).
| Environment Variable | Default Value | Description |
|---|---|---|
|
not set |
Maximum time in seconds to wait for a conversion to finish. If not set, unoserver uses its default. |
|
not set |
Number of conversions after which unoserver will stop (to avoid memory leaks). If not set, unoserver runs indefinitely. |
# Set conversion timeout to 120 seconds and stop after 500 conversions
docker run -p 2003:2003 -e CONVERSION_TIMEOUT=120 -e STOP_AFTER=500 ghcr.io/unoconv/unoserver-docker# Only set conversion timeout, let unoserver use its default for stop-after
docker run -p 2003:2003 -e CONVERSION_TIMEOUT=180 ghcr.io/unoconv/unoserver-docker# Use unoserver defaults for all parameters
docker run -p 2003:2003 ghcr.io/unoconv/unoserver-docker-
Why do I get an error during when converting is writing/exporting to file?
-
It’s very likely that you haven’t given the container write permission to the mounted data directory. See: Issue #44