Skip to content

Instantly share code, notes, and snippets.

@Lewiscowles1986
Last active September 1, 2017 09:58
Show Gist options
  • Save Lewiscowles1986/790deceea8e08949313cb7379de9e17a to your computer and use it in GitHub Desktop.
Save Lewiscowles1986/790deceea8e08949313cb7379de9e17a to your computer and use it in GitHub Desktop.
Libreoffice Docker
FROM ubuntu:16.04
MAINTAINER CD2 Team <codesign2@icloud.com>
ENV DEBIAN_FRONTEND noninteractive
RUN useradd -m libreoffice
ENV LIBREOFFICEPREFERREDMIRROR http://download.documentfoundation.org/libreoffice/stable/5.4.1/deb/x86_64/
ENV LIBREOFFICEPACKAGE LibreOffice_5.4.1_Linux_x86-64_deb.tar.gz
ENV LIBREOFFICEDIR LibreOffice_5.4.1.2_Linux_x86-64_deb
RUN apt-get update -yqq \
&& apt-get install -yqq --no-install-recommends wget \
libfontconfig \
libfreetype6 \
libxrender1 \
libdbus-glib-1-2 \
libgtk-3-0 \
libxcomposite1 \
libxdamage1 \
libdbus-glib-1-2 \
libsm6 \
openjdk-8-jre \
libcanberra-gtk3-0 \
libcanberra-gtk3-module \
libcanberra-gtk0 \
libcanberra-gtk-module \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean -yqq \
&& wget -q $LIBREOFFICEPREFERREDMIRROR$LIBREOFFICEPACKAGE -O /tmp/$LIBREOFFICEPACKAGE \
&& mkdir /tmp/LibreOffice \
&& tar -xzf /tmp/$LIBREOFFICEPACKAGE -C /tmp/LibreOffice \
&& dpkg -i /tmp/LibreOffice/$LIBREOFFICEDIR/DEBS/*.deb \
&& rm -f /tmp/$LIBREOFFICEPACKAGE \
&& rm -rf /tmp/LibreOffice*
COPY start-libreoffice.sh /tmp/
ENTRYPOINT ["/tmp/start-libreoffice.sh"]
#!/bin/bash
groupmod -g $gid libreoffice
usermod -u $uid -g $gid libreoffice
if [ -d /home/libreoffice/.config/libreoffice ]; then
chown -R libreoffice:libreoffice /home/libreoffice/.config/libreoffice
fi
exec su -ls "/bin/bash" -c "mkdir -p /home/libreoffice/.local/share; libreoffice5.4 " libreoffice
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment