summaryrefslogtreecommitdiffstats
path: root/docker
diff options
context:
space:
mode:
authorMarco Marinello <marinello@libreoffice.org>2020-05-08 12:34:48 +0200
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2020-05-14 10:08:56 +0200
commit607ddbff466d145d0dcf87b2759c7e4d02b28f1d (patch)
tree8b598d4326fa025e407cfb6bc0b67f991dbe7b12 /docker
parentProxy: significantly simplify proxy socket. (diff)
downloadonline-607ddbff466d145d0dcf87b2759c7e4d02b28f1d.tar.gz
online-607ddbff466d145d0dcf87b2759c7e4d02b28f1d.zip
Enhance build system: support multiple OS as host and pull the image before build
Change-Id: Ic9875dd1aa49335df83cc6a8492144450f725f31 Signed-off-by: Marco Marinello <marinello@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92665 Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'docker')
-rw-r--r--docker/Debian46
-rw-r--r--docker/Ubuntu (renamed from docker/Dockerfile)0
-rwxr-xr-xdocker/l10n-docker-nightly.sh23
3 files changed, 66 insertions, 3 deletions
diff --git a/docker/Debian b/docker/Debian
new file mode 100644
index 0000000000..b43bc4a325
--- /dev/null
+++ b/docker/Debian
@@ -0,0 +1,46 @@
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+FROM debian:stable
+
+# get the latest fixes
+RUN apt-get update
+
+# install LibreOffice run-time dependencies
+# install adduser, findutils, openssl and cpio that we need later
+# install an editor
+RUN apt-get -y install locales-all libpng16-16 fontconfig adduser cpio findutils nano libpoco-dev libcap2-bin openssl inotify-tools procps libubsan0 libubsan1 openssh-client
+
+# tdf#117557 - Add CJK Fonts to LibreOffice Online Docker Image
+RUN apt-get -y install fonts-wqy-zenhei fonts-wqy-microhei fonts-droid-fallback fonts-noto-cjk
+
+# copy freshly built LibreOffice master and LibreOffice Online master with latest translations
+COPY /instdir /
+
+# copy the shell script which can start LibreOffice Online (loolwsd)
+COPY /scripts/run-lool.sh /
+
+# set up LibreOffice Online (normally done by postinstall script of package)
+RUN setcap cap_fowner,cap_mknod,cap_sys_chroot=ep /usr/bin/loolforkit
+RUN adduser --quiet --system --group --home /opt/lool lool
+RUN mkdir -p /var/cache/loolwsd && chown lool: /var/cache/loolwsd
+RUN rm -rf /var/cache/loolwsd/*
+RUN rm -rf /opt/lool
+RUN mkdir -p /opt/lool/child-roots
+RUN loolwsd-systemplate-setup /opt/lool/systemplate /opt/libreoffice >/dev/null 2>&1
+RUN touch /var/log/loolwsd.log
+# Fix permissions
+RUN chown lool:lool /var/log/loolwsd.log
+RUN chown -R lool:lool /opt/
+RUN chown -R lool:lool /etc/loolwsd
+
+EXPOSE 9980
+
+# switch to lool user (use numeric user id to be compatible with Kubernetes Pod Security Policies)
+USER 101
+
+CMD bash /run-lool.sh
+
diff --git a/docker/Dockerfile b/docker/Ubuntu
index 070826bf12..070826bf12 100644
--- a/docker/Dockerfile
+++ b/docker/Ubuntu
diff --git a/docker/l10n-docker-nightly.sh b/docker/l10n-docker-nightly.sh
index 9bbb4ad4a0..e921a42837 100755
--- a/docker/l10n-docker-nightly.sh
+++ b/docker/l10n-docker-nightly.sh
@@ -51,9 +51,22 @@ if [ -z "$LIBREOFFICE_BUILD_TARGET" ]; then
fi;
echo "LibreOffice build target: '$LIBREOFFICE_BUILD_TARGET'"
-# do everything in the builddir
+
SRCDIR=$(realpath `dirname $0`)
-INSTDIR="$SRCDIR/instdir"
+
+if [ -z "$(lsb_release -si)" ]; then
+ echo "WARNING: Unable to determine your distribution"
+ echo "(Is lsb_release installed?)"
+ echo "Using Ubuntu Dockerfile."
+ HOST_OS="Ubuntu"
+else
+ HOST_OS=$(lsb_release -si)
+fi
+if ! [ -e "$HOST_OS" ]; then
+ echo "There is no suitable Dockerfile for your host system."
+ echo "Please fix this problem and re-run $0"
+ exit 1
+fi
BUILDDIR="$SRCDIR/builddir"
mkdir -p "$BUILDDIR"
@@ -104,7 +117,11 @@ cp -a libreoffice/instdir "$INSTDIR"/opt/libreoffice
# Create new docker image
if [ -z "$NO_DOCKER_IMAGE" ]; then
cd "$SRCDIR"
- docker build --no-cache -t $DOCKER_HUB_REPO:$DOCKER_HUB_TAG . || exit 1
+
+ # Pull the image first to be sure we're using the latest available
+ docker pull $(grep "FROM " $HOST_OS | cut -d ' ' -f 2)
+
+ docker build --no-cache -t $DOCKER_HUB_REPO:$DOCKER_HUB_TAG -f $HOST_OS . || exit 1
if [ -z "$NO_DOCKER_PUSH" ]; then
docker push $DOCKER_HUB_REPO:$DOCKER_HUB_TAG || exit 1
fi;