FROM ubuntu:16.10

ENV DEBIAN_FRONTEND noninteractive

## Create a 'docker' user
RUN  addgroup --gid 9999 docker \
  && adduser --uid 9999 --gid 9999 --disabled-password --gecos "Docker User" docker \
  && usermod -L docker

RUN apt-get clean           \
 && rm -rf /var/lib/apt/lists/* \
 && apt-get update          \
 && apt-get install -y      \
    ghostscript             \
    libxinerama1            \
    libdbus-glib-1-2        \
    libcairo2               \
    libcups2                \
    libgl1-mesa-dri         \
    libgl1-mesa-glx         \
    libsm6                  \
    fonts-opensymbol        \
    hyphen-fr               \
    hyphen-de               \
    hyphen-en-us            \
    hyphen-it               \
    hyphen-ru               \
    fonts-dejavu            \
    fonts-dejavu-core       \
    fonts-dejavu-extra      \
    fonts-dustin            \
    fonts-f500              \
    fonts-fanwood           \
    fonts-freefont-ttf      \
    fonts-liberation        \
    fonts-lmodern           \
    fonts-lyx               \
    fonts-sil-gentium       \
    fonts-texgyre           \
    fonts-tlwg-purisa       \
    curl                    \
    --no-install-recommends \
 && apt-get clean \
 && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN mkdir /tmp/lo \
  && cd /tmp/lo \
  && curl -L -k https://download.documentfoundation.org/libreoffice/stable/5.3.0/deb/x86_64/LibreOffice_5.3.0_Linux_x86-64_deb.tar.gz | tar xz --strip-components=1 \
  && cd DEBS \
  && dpkg -i *.deb \
  && rm -fr /tmp/lo

# for compat with canvadocs converter, which hardcodes path to soffice
RUN ln -s /opt/libreoffice5.3/program/soffice /usr/bin/soffice
ENV PATH $PATH:/opt/libreoffice5.3/program

USER docker

Create libreoffice image version 5.3 build
Create libreoffice image version 5.3 build

Refs RD-3534

Change-Id: Ia42aed1ab46db2e9c4e3aebe0b6a3c587400d3bc
Reviewed-on: https://gerrit.instructure.com/101185
QA-Review: Caleb Guanzon <54fa1f30d451e4f3c341a8f3c47c9215fd0be9c6@instructure.com>
Reviewed-by: Josh Orr <a2b6e8624e42637b1fd540dea491d88242856463@instructure.com>
Product-Review: Benjamin Porter <fdd60f2e3d506934848b3d0fff79c55f544a2d47@instructure.com>
Tested-by: Benjamin Porter <fdd60f2e3d506934848b3d0fff79c55f544a2d47@instructure.com>
