Skip to content

Instantly share code, notes, and snippets.

@Pyppe
Last active February 11, 2016 08:43
Show Gist options
  • Save Pyppe/b1ec0f91bfe24d2d1235 to your computer and use it in GitHub Desktop.
Save Pyppe/b1ec0f91bfe24d2d1235 to your computer and use it in GitHub Desktop.
Docker libreoffice as a DOCX to PDF conversion service
FROM ubuntu:14.04.3
MAINTAINER Pyppe
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get -y install software-properties-common
RUN add-apt-repository -y ppa:libreoffice/ppa
RUN apt-get -y update
RUN apt-get install -y libreoffice ttf-kochi-mincho
# You may add some custom fonts for better conversion results
COPY ./* /root/.fonts/
RUN fc-cache -f /root/.fonts
# Build
docker build -t libreoffice $DIR_TO_Dockerfile
# Test docx to PDF conversion
docker run --name libreoffice -it --rm \
-v /tmp:/tmp \
libreoffice \
/convert-to-pdf.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment